0.0.1 • Published 6 years ago
hashlib-js v0.0.1
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
Param | Type | Description |
---|---|---|
bytes | number | The 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
Param | Type | Description |
---|---|---|
plaintext | string | The password in plaintext |
salt | string | An 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)
Param | Type | Description |
---|---|---|
plaintext | string | The plaintext password |
hashed | string | The hashed password to check against |
salt | string | The salt used to hash the given hash |
0.0.1
6 years ago