/// import type { HashingOptions, InstanceOptions, VerificationOptions } from "./options"; export declare const instanceDefaults: Required; export interface HashingAdapter { readonly name: string; hash(options: HashingOptions): Promise; verify(options: VerificationOptions): Promise; } export type AdapterClass = new (options: InstanceOptions) => HashingAdapter; /** * * * @export * @class AlgorithmsMismatchError * @extends {Error} */ export declare class AlgorithmsMismatchError extends Error { expected: string; encoded: string; /** * Creates an instance of AlgorithmsMismatchError. * @param {string} expected * @param {string} encoded * @memberof AlgorithmsMismatchError */ constructor(expected: string, encoded: string); } /** * * * @export * @abstract * @class BaseHashingAdapter */ export declare abstract class BaseHashingAdapter implements HashingAdapter { protected readonly _options: InstanceOptions; abstract readonly name: string; /** * Creates an instance of BaseHashingAdapter. * @param {InstanceOptions} [options={}] * @memberof BaseHashingAdapter */ constructor(options?: InstanceOptions); /** * * * @param {HashingOptions} options * @memberof BaseHashingAdapter */ hash(options: HashingOptions): Promise; /** * * * @param {VerificationOptions} options * @return {Promise} {Promise} * @memberof BaseHashingAdapter */ verify(options: VerificationOptions): Promise; protected abstract _hash(password: Buffer, salt: Buffer | undefined): Promise; /** * * * @protected * @param {Buffer} password * @param {Buffer=} salt * @param {Buffer} hash * @return {Promise} {Promise} * @memberof BaseHashingAdapter */ protected _verify(password: Buffer, salt: Buffer | undefined, hash: Buffer): Promise; }