/** * Turn `{ hashAlgo, hashFn }` into a concrete * `(plaintext: string) => Promise`. Custom `hashFn` wins over * the built-in `hashAlgo` shortcut. * * Default: `sha256` + hex output. * * @param {{ hashAlgo?: string, hashFn?: (pt: string) => string | Promise }} [opts] * @returns {(plaintext: string) => Promise} */ export function resolveHashFn(opts?: { hashAlgo?: string; hashFn?: (pt: string) => string | Promise; }): (plaintext: string) => Promise; /** * Turn an encoding shortcut into a `(bytes: Buffer) => string` encoder. * * Built-in shortcuts: `'base64url'` (default), `'base64'`, `'hex'`, * `'crockford'` (Crockford Base32, RFC 4648-ish with I/L/O/U dropped), * `'uuid'` (returns a v4 UUID string; ignores input bytes). * * @param {string} [encoding] * @returns {(bytes: Buffer) => string} */ export function resolveEncoding(encoding?: string): (bytes: Buffer) => string; import { resolveOrCall } from '@exortek/shared/resolve'; import { randomBuffer } from '@exortek/shared/resolve'; export { resolveOrCall, randomBuffer };