UNPKG

check-wordpress-password

Version:

Check a WordPress generated password hash against a password

18 lines 814 B
/** * Generates a hash for a given password using a random salt and specified iteration count. * * @param {string} password - The password to hash. * @param {number} iterationCountLog2 - Log2 of the iteration count (must be between 7 and 30). * @returns {string} The generated hashed password. * @throws {Error} If the iteration count log2 is out of range. */ export declare function generateHash(password: string, iterationCountLog2: number): string; /** * Verifies a password against a hashed password. * * @param {string} password - The password to verify. * @param {string} hash - The hashed password. * @returns {boolean} True if the password matches the hash, otherwise false. */ export declare function checkPassword(password: string, hash: string): boolean; //# sourceMappingURL=index.d.ts.map