UNPKG

asset-hash

Version:

Very fast asset hashing function for using e.g. during front-end deployments.

13 lines (12 loc) 481 B
/// <reference types="node" /> export declare type DigestResult = number | bigint | Buffer; export declare type HashAlgorithm = "xxhash32" | "xxhash64" | "farmhash32" | "farmhash64" | "md5" | "sha1" | "sha256" | "sha512"; export declare function initHashClasses(): Promise<void>; export interface Hash { update(input: string | Buffer): Hash; digest(): DigestResult; } /** * Creates hasher instance */ export declare function createHasher(algorithm: HashAlgorithm): Hash;