UNPKG

@posthog/siphash

Version:

SipHash-2-4 fast short-input pseudo-random function

11 lines (10 loc) 437 B
interface IU64 { l: number; h: number; } export declare function hash(key: Uint32Array, m: Uint8Array | string): IU64; export declare function hash_hex(key: Uint32Array, m: Uint8Array | string): string; export declare function hash_uint(key: Uint32Array, m: Uint8Array | string): number; export declare function string_to_u8(str: string): Uint8Array; export declare function string16_to_key(str: string): Uint32Array; export {};