Browse Source
Merge pull request #19989 from abpframework/issue-17786
Angular - Updating Random Password Generator
pull/19997/head
oykuermann
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
4 additions and
4 deletions
-
npm/ng-packs/packages/core/src/lib/utils/generator-utils.ts
|
|
|
@ -19,10 +19,10 @@ export function generateHash(value: string): number { |
|
|
|
export function generatePassword(length = 8) { |
|
|
|
length = Math.min(Math.max(4, length), 128); |
|
|
|
|
|
|
|
const lowers = 'abcdefghijklmnopqrstuvwxyz'; |
|
|
|
const uppers = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; |
|
|
|
const numbers = '0123456789'; |
|
|
|
const specials = '!@#$%&*()_+{}<>?[]./'; |
|
|
|
const lowers = 'abcdefghjkmnpqrstuvwxyz'; |
|
|
|
const uppers = 'ABCDEFGHJKMNPQRSTUVWXYZ'; |
|
|
|
const numbers = '23456789'; |
|
|
|
const specials = '!*_#/+-.'; |
|
|
|
const all = lowers + uppers + numbers + specials; |
|
|
|
|
|
|
|
const getRandom = (chrSet: string) => chrSet[Math.floor(Math.random() * chrSet.length)]; |
|
|
|
|