/** * Implements a constant-time comparison algorithm. * * @param a Original string (running time is always proportional to its length) * @param b String to compare to original string * @returns Returns true if `a` is equal to `b`, without leaking timing information that would allow an attacker to guess one of the values. */ declare function fixedTimeComparison(a: string, b: string): boolean; type DigestData = BufferSource | Uint8Array | string; declare function digest(alg: AlgorithmIdentifier, data: DigestData): Promise; /** * Gets the key length in bytes for a given hash algorithm. * - `SHA-1`: 20 bytes * - `SHA-256`: 32 bytes * - `SHA-384`: 48 bytes * - `SHA-512`: 64 bytes * - `RSA-OAEP`: 256 bytes * - `RSA-PSS`: 256 bytes * - `RSA-ES`: 256 bytes * * ### Note: Unsupported algorithms default to 32 bytes. */ declare function klen(alg: HashAlgorithmIdentifier): number; export { digest, fixedTimeComparison, klen }; export type { DigestData };