UNPKG

inthash

Version:

Efficient integer hashing library using Knuth's multiplicative method for Javascript and Typescript, perfect for obfuscating sequential numbers.

22 lines 575 B
export interface HasherOptions { bits: number; prime: string; inverse: string; xor: string; } export declare class Hasher { static generate(bits?: number): HasherOptions; _prime: bigint; _inverse: bigint; _xor: bigint; _mask: bigint; _max: bigint; constructor({ bits, prime, inverse, xor }: HasherOptions); encode(n: number): number; encode(n: bigint): bigint; encode(n: string): string; decode(n: number): number; decode(n: bigint): bigint; decode(n: string): string; } //# sourceMappingURL=hasher.d.ts.map