It can generate a unique password based on some information you provide
$ npm i @jsweibo/password-generator-core
const PasswordGeneratorCore = require('@jsweibo/password-generator-core');
// generate HYBRID_TYPE password
console.log(
new PasswordGeneratorCore({
passwordLength: 6,
publicKey: 'example.com',
privateKey: 'example',
timestamp: 1577836800000,
}).text
); // !01a3A
// generate ALPHABETIC_AND_DIGITAL_TYPE password
console.log(
new PasswordGeneratorCore({
passwordType: 1,
passwordLength: 6,
publicKey: 'example.com',
privateKey: 'example',
timestamp: 1577836800000,
}).text
); // 001a3A
// generate ALPHABETIC_TYPE password
console.log(
new PasswordGeneratorCore({
passwordType: 2,
passwordLength: 6,
publicKey: 'example.com',
privateKey: 'example',
timestamp: 1577836800000,
}).text
); // eaAeeB
// generate DIGITAL_TYPE password
console.log(
new PasswordGeneratorCore({
passwordType: 3,
passwordLength: 6,
publicKey: 'example.com',
privateKey: 'example',
timestamp: 1577836800000,
}).text
); // 104730
- variable type:
Number
- default value:
0
value | meaning | example |
---|---|---|
0 | HYBRID_TYPE | !01a3A |
1 | ALPHABETIC_AND_DIGITAL_TYPE | 001a3A |
2 | ALPHABETIC_TYPE | eaAeeB |
3 | DIGITAL_TYPE | 104730 |
- variable type:
Number
- required
- variable type:
String
- required
- variable type:
String
- required
- variable type:
Number
- required
Copyright (c) 2021-present jsweibo