/** * Cryptographic primitives usable from Cloudflare Workers. * * All helpers wrap Web Crypto (available in the Workers runtime) and return * hex strings for D1-friendly storage. Nothing here allocates outside the * request scope. */ /** * Random numeric one-time password. Default 6 digits (~20 bits entropy) — * sufficient when paired with rate-limited verification (≤ 5 tries) and a * short TTL (≤ 10 minutes). Bump `length` if the guarantees are looser. */ export declare function generateOtpCode(length?: number): string; /** * Session token — cryptographically-random hex string. Default 32 bytes * (256 bits) which is more than enough for cookie session identifiers. */ export declare function generateRandomToken(byteLength?: number): string; /** SHA-256 of the input string, hex-encoded. */ export declare function sha256Hex(input: string): Promise; /** * OTP hash with per-owner salt. Pass a stable value (phone number, user id) * as `salt` so hashes cannot be compared across owners. */ export declare function hashOtpCode(code: string, salt: string): Promise; /** Hash a session token before persisting; the plain token lives only in the cookie. */ export declare function hashSessionToken(token: string): Promise; //# sourceMappingURL=crypto.d.ts.map