Skip to content

jsweibo/password-generator-core

Repository files navigation

@jsweibo/password-generator-core

npm npm npm

It can generate a unique password based on some information you provide

Install

$ npm i @jsweibo/password-generator-core

Example

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

options

passwordType

  • 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

passwordLength

  • variable type: Number
  • required

publicKey

  • variable type: String
  • required

privateKey

  • variable type: String
  • required

timestamp

  • variable type: Number
  • required

license

MIT

Copyright (c) 2021-present jsweibo

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published