Skip to content

greybax/Password.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 

Repository files navigation

Password.js

Javascript library for generate random passwords Demo

Possible characters in passwords are:

  • 0123456789
  • abcdefghijklmnopqrstuvwxyz
  • ABCDEFGHIJKLMNOPQRSTUVWXYZ
  • -_!@#$%^&*()+/{[]}|\;:'<>?

Config settings (by default):

If you want you can override this config (for example Password.config.useDigits = false)


  config: {
  			useDigits               : true,
  			useAlphabet             : true,
  			useAlphabetCapitalized  : true,
  			useSpec                 : true,
		numberOfPasswords       : 1,
		length                  : 5
	}

Check password entropy:

bits = Math.floor(Math.log(charset)*(lenght/Math.log(2)))

  • bits - bit resistance
  • log - natural logarithm
  • length - password length
  • charset - sets the total size for each of the types below, if they exist in possible characters in passwords
Example: Password.checkEntropy('jjF25jVNGI') equals 59

Encrypt password:

It's usefull method for generating password from your phrase, that you can simply remember

Example: Password.encrypt('my_password',10) returns password KElY91usje

Simply to use:

  • Put it library in you project and link it
  • Configure it in Password.config settings
  • Password.generate() returns passwords in JSON format

Releases

No releases published

Packages

No packages published