| |
| import { HashInput } from './hash-fn'; |
| import { IHasher, IInternalHash, IHasherDigestOptions } from '../base/index'; |
| import { Transform, TransformCallback } from 'stream'; |
| import { IBaseHashOptions } from '../base/hash-fn'; |
| import { NodeHashReader } from './hash-reader'; |
| export interface INodeHash extends IHasher<Buffer> { |
| |
| |
| |
| |
| update(data: HashInput, encoding?: BufferEncoding): this; |
| |
| |
| |
| |
| digest(options?: IBaseHashOptions): Buffer; |
| |
| |
| |
| digest(encoding: undefined, options: IBaseHashOptions): Buffer; |
| |
| |
| |
| digest(encoding: BufferEncoding, options?: IBaseHashOptions): string; |
| } |
| |
| |
| |
| export declare class NodeHash<Reader> extends Transform implements IHasher<Buffer> { |
| private readonly hash; |
| constructor(implementation: IInternalHash<Reader>, getReader: (r: Reader) => NodeHashReader); |
| |
| |
| |
| reader(options?: { |
| dispose?: boolean; |
| }): NodeHashReader; |
| |
| |
| |
| update(data: HashInput, encoding?: BufferEncoding): this; |
| |
| |
| |
| digest(encoding?: IHasherDigestOptions): Buffer; |
| digest(encoding: undefined, options: IHasherDigestOptions): Buffer; |
| digest(encoding: BufferEncoding, options?: IHasherDigestOptions): string; |
| |
| |
| |
| dispose(): void; |
| |
| |
| |
| |
| _transform(chunk: Buffer | string, encoding: string, callback: TransformCallback): void; |
| |
| |
| |
| |
| _flush(callback: TransformCallback): void; |
| } |
| |
| |
| |
| export declare const createHash: () => NodeHash<import("../../dist/wasm/nodejs/blake3_js").HashReader>; |
| |
| |
| |
| export declare const createKeyed: (key: Buffer) => NodeHash<import("../../dist/wasm/nodejs/blake3_js").HashReader>; |
| |
| |
| |
| export declare const createDeriveKey: (context: string) => NodeHash<import("../../dist/wasm/nodejs/blake3_js").HashReader>; |
|
|