@password-generator/package
Version:
Package with the algorithm to generate password
19 lines (18 loc) • 608 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const generateCharacter = {
uppercase() {
return String.fromCharCode(Math.floor(Math.random() * 26) + 65);
},
lowercase() {
return String.fromCharCode(Math.floor(Math.random() * 26) + 65).toLowerCase();
},
numbers() {
return String.fromCharCode(Math.floor(Math.random() * 10) + 48);
},
symbols() {
const symbolsString = '!@#$%^&*(){}[]=<>/,.';
return symbolsString[Math.floor(Math.random() * symbolsString.length)];
},
};
exports.default = generateCharacter;