sorthash
Encryption library
Current features
- Hash passwords, with salt
- Compare passwords
- Generate random strings composed of numbers or characters
Important to know
You need to store both the password and salt in order to compare later.
Usage of the password hash / compare functions
// Includes sorthashconst sorthash = ; // Hashes the passwordvar password = "Example123";var saltLength = 20; var hash salt = sorthashhashpassword saltLength; // Returns something like this: aabbbcchhwwxx11133455 // Compares the passwordif sorthash // -> The passwords match else // -> The passwords don't match
Usage of the randomstring generator
// Includes sorthashconst sorthash = ; // Generates random chars, the length must be between 1 and 500var chars = sorthash; // Generates random numbersvar chars = sorthash;