import { type IDataType } from "./util"; export interface IArgon2Options { /** * Password (or message) to be hashed */ password: IDataType; /** * Salt (usually containing random bytes) */ salt: IDataType; /** * Secret for keyed hashing */ secret?: IDataType; /** * Number of iterations to perform */ iterations: number; /** * Degree of parallelism */ parallelism: number; /** * Amount of memory to be used in kibibytes (1024 bytes) */ memorySize: number; /** * Output size in bytes */ hashLength: number; /** * Desired output type. Defaults to 'hex' */ outputType?: "hex" | "binary" | "encoded"; } interface IArgon2OptionsBinary { outputType: "binary"; } type Argon2ReturnType = T extends IArgon2OptionsBinary ? Uint8Array : string; /** * Calculates hash using the argon2i password-hashing function * @returns Computed hash */ export declare function argon2i(options: T): Promise>; /** * Calculates hash using the argon2id password-hashing function * @returns Computed hash */ export declare function argon2id(options: T): Promise>; /** * Calculates hash using the argon2d password-hashing function * @returns Computed hash */ export declare function argon2d(options: T): Promise>; export interface Argon2VerifyOptions { /** * Password to be verified */ password: IDataType; /** * Secret used on hash creation */ secret?: IDataType; /** * A previously generated argon2 hash in the 'encoded' output format */ hash: string; } /** * Verifies password using the argon2 password-hashing function * @returns True if the encoded hash matches the password */ export declare function argon2Verify(options: Argon2VerifyOptions): Promise; export {};