@foal/core
Version:
Full-featured Node.js framework, with no complexity
17 lines (16 loc) • 578 B
TypeScript
export declare const PASSWORD_ITERATIONS = 310000;
/**
* Hash a password using the PBKDF2 algorithm.
*
* Configured to use PBKDF2 + HMAC + SHA256.
* The result is a 64 byte binary string.
*
* The random salt is 16 bytes long.
* The number of iterations is 310000.
* The length key is 32 bytes long.
*
* @export
* @param {string} plainTextPassword - The password to hash.
* @returns {Promise<string>} The derived key with the algorithm name, the number of iterations and the salt.
*/
export declare function hashPassword(plainTextPassword: string): Promise<string>;