import type { PasswordHash, PasswordSalt, PasswordOpsLimitChoice, PasswordOpsLimit, PasswordMemLimitChoice, PasswordMemLimit } from '../types.js'; /** * Use the `min` limit during testing to improve performance. */ declare const passwordOpsLimits: Record; /** * Use the `min` limit during testing to improve performance. */ declare const passwordMemLimits: Record; /** * These are the default computational parameters for password hashing. * They can be changed to increase or decrease the computational cost. * This ensures that deriving a key from a password uses * 256 MiB of RAM and 0.7 seconds on a 2.8 GHz Intel Core i7. * These need to be consistent to ensure the same hash is produced. */ declare const passwordOpsLimitDefault: PasswordOpsLimit; declare const passwordMemLimitDefault: PasswordMemLimit; declare function isPasswordOpsLimit(opsLimit: number): opsLimit is PasswordOpsLimit; declare function isPasswordMemLimit(memLimit: number): memLimit is PasswordMemLimit; /** * Hashes the password and returns a 256-bit hash and 128-bit salt. * The 256-bit hash can be used as a key for symmetric encryption/decryption. * Pass the salt in case you are trying to get the same hash. * The returned buffers are guaranteed to unpooled. * This means the underlying `ArrayBuffer` is safely transferrable. */ declare function hashPassword(password: string, salt?: PasswordSalt, opsLimit?: PasswordOpsLimit, memLimit?: PasswordMemLimit): [PasswordHash, PasswordSalt]; /** * Checks the password. * The returned buffers are guaranteed to unpooled. * This means the underlying `ArrayBuffer` is safely transferrable. */ declare function checkPassword(password: string, hash: PasswordHash, salt: PasswordSalt, opsLimit?: PasswordOpsLimit, memLimit?: PasswordMemLimit): boolean; export { passwordOpsLimits, passwordMemLimits, passwordOpsLimitDefault, passwordMemLimitDefault, isPasswordOpsLimit, isPasswordMemLimit, hashPassword, checkPassword, };