0.0.1 • Published 6 years ago

hashlib-js v0.0.1

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
6 years ago

Functions

generateSalt(bytes) ⇒ Promise.<string>

Generates a random salt that is bytes in length

Kind: global function
Returns: Promise.<string> - A promise that returns the salt hashed, hex-encoded salt string

ParamTypeDescription
bytesnumberThe number of bytes for the generated salt

hashPassword(plaintext, salt) ⇒ Promise.<Array.<string>>

Hashes the given plaintext password

Kind: global function
Returns: Promise.<Array.<string>> - A Promise that returns the hashed, hex-encoded password string and hex-encoded salt used as a 2-element array

ParamTypeDescription
plaintextstringThe password in plaintext
saltstringAn optional salt to use while hashing

validatePassword(plaintext, hashed, salt) ⇒ Promise.<Boolean>

Validates the given password against the given hash/salt

Kind: global function
Returns: Promise.<Boolean> - A promise to return a boolean (whether plaintext matches hashed)

ParamTypeDescription
plaintextstringThe plaintext password
hashedstringThe hashed password to check against
saltstringThe salt used to hash the given hash
0.0.1

6 years ago