Browse Source

refactor(core): add max length control to generatePassword fn

pull/3678/head
mehmet-erim 6 years ago
parent
commit
07fe9960d0
  1. 2
      npm/ng-packs/packages/core/src/lib/utils/generator-utils.ts

2
npm/ng-packs/packages/core/src/lib/utils/generator-utils.ts

@ -19,7 +19,7 @@ export function generateHash(value: string): number {
}
export function generatePassword(length = 8) {
length = length < 4 ? 4 : length;
length = Math.min(Math.max(4, length), 128);
const lowers = 'abcdefghijklmnopqrstuvwxyz';
const uppers = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';

Loading…
Cancel
Save