Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function rand(min, max) {
- return Math.random() * (max - min + 1) - min;
- }
- function randInt(min, max) {
- return Math.floor(rand(min, max));
- }
- function randPassword(required) {
- if (required === undefined) {
- required = 6;
- }
- var chars = '1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm';
- var password = '';
- for (var i = 0; i < required; ++i) {
- password += chars.charAt(Math.floor(Math.random() * chars.length));
- }
- return password;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement