Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const { floor, random } = Math;
- export function GetPassword(lenght: number = 10): string {
- const dictionary = 'qwertyupasdfghkxcbnmQWERTYUPASDFGHKZXCBNM123456789';
- let password = '';
- for (let i = 0; i < lenght; ++i) {
- password += dictionary.charAt(floor(random() * dictionary.length));
- }
- return password;
- }
Add Comment
Please, Sign In to add comment