|
|
@ -19,10 +19,10 @@ export function generateHash(value: string): number { |
|
|
export function generatePassword(length = 8) { |
|
|
export function generatePassword(length = 8) { |
|
|
length = Math.min(Math.max(4, length), 128); |
|
|
length = Math.min(Math.max(4, length), 128); |
|
|
|
|
|
|
|
|
const lowers = 'abcdefghijklmnopqrstuvwxyz'; |
|
|
const lowers = 'abcdefghjkmnpqrstuvwxyz'; |
|
|
const uppers = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; |
|
|
const uppers = 'ABCDEFGHJKMNPQRSTUVWXYZ'; |
|
|
const numbers = '0123456789'; |
|
|
const numbers = '23456789'; |
|
|
const specials = '!@#$%&*()_+{}<>?[]./'; |
|
|
const specials = '!*_#/+-.'; |
|
|
const all = lowers + uppers + numbers + specials; |
|
|
const all = lowers + uppers + numbers + specials; |
|
|
|
|
|
|
|
|
const getRandom = (chrSet: string) => chrSet[Math.floor(Math.random() * chrSet.length)]; |
|
|
const getRandom = (chrSet: string) => chrSet[Math.floor(Math.random() * chrSet.length)]; |
|
|
|