/** * SHA-256 that can be fed in pieces, as `createHash('sha256')` is, with the same digest. Strings are * hashed as UTF-8. Synchronous, unlike Web Crypto's `digest()`, so a cache key can be computed where * it is needed. */ export declare class Sha256 { private readonly state; private readonly block; private readonly words; private filled; private total; /** Adds data: a string, as UTF-8, or bytes. */ update(data: string | Uint8Array): this; /** The digest as lowercase hex. The hash takes no more data afterwards. */ digest(): string; private compress; } /** * The SHA-256 digest of a string, as UTF-8, or of bytes, as lowercase hex. Native where the runtime * has it, which is ten times faster on large inputs, and the same digest everywhere else. */ export declare function sha256Hex(data: string | Uint8Array): string; /** A SHA-256 fed in pieces, as a stream's bytes arrive. */ export interface IncrementalSha256 { /** Adds bytes. */ update(data: Uint8Array): unknown; /** The digest so far, as lowercase hex. Call once, at the end. */ digest(): string; } /** A SHA-256 to feed in pieces: native where the runtime has it, and the same digest everywhere else. */ export declare function createSha256(): IncrementalSha256;