Guest User

Untitled

a guest
Jul 23rd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. const { floor, random } = Math;
  2.  
  3. export function GetPassword(lenght: number = 10): string {
  4. const dictionary = 'qwertyupasdfghkxcbnmQWERTYUPASDFGHKZXCBNM123456789';
  5. let password = '';
  6.  
  7. for (let i = 0; i < lenght; ++i) {
  8. password += dictionary.charAt(floor(random() * dictionary.length));
  9. }
  10.  
  11. return password;
  12. }
Add Comment
Please, Sign In to add comment