import { VSBuffer } from "./buffer.js"; type NotSyncHashable = ArrayBufferLike | ArrayBufferView; /** * Return a hash value for an object. * * Note that this should not be used for binary data types. Instead, * prefer {@link hashAsync}. */ export declare function hash(obj: T extends NotSyncHashable ? never : T): number; export declare function doHash(obj: unknown, hashVal: number): number; export declare function numberHash(val: number, initialHashVal: number): number; export declare function stringHash(s: string, hashVal: number): number; /** * Returns whether a string belongs to a stable percentage sample. */ export declare function isStringInSample(value: string, samplePercentage: number): boolean; /** Precomputes the affine transform of {@link stringHash} for a fixed string and int32 accumulators. */ export declare class ConstantStringHash { private readonly multiplier; private readonly addend; constructor(value: string); /** Equivalent to `stringHash(value, hashVal)` for int32 `hashVal`. */ apply(hashVal: number): number; } /** Seed mixed in by {@link arrayHash} before hashing the array elements. */ export declare const ARRAY_HASH_SEED = 104579; /** Seed mixed in by {@link objectHash} before hashing the object entries. */ export declare const OBJECT_HASH_SEED = 181387; /** Hashes the input as SHA-1, returning a hex-encoded string. */ export declare const hashAsync: (input: string | ArrayBufferView | VSBuffer) => Promise; /** * A SHA1 implementation that works with strings and does not allocate. * * Prefer to use {@link hashAsync} in async contexts */ export declare class StringSHA1 { private static _bigBlock32; private _h0; private _h1; private _h2; private _h3; private _h4; private readonly _buff; private readonly _buffDV; private _buffLen; private _totalLen; private _leftoverHighSurrogate; private _finished; constructor(); update(str: string): void; private _push; digest(): string; private _wrapUp; private _step; } export {};