File size: 1,017 Bytes
0865492
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
 * gearhash-jit — Fast GEAR rolling hash for content-defined chunking.
 *
 * Uses a tiny hand-written WASM module with native i64 arithmetic.
 * The hash state is kept as raw bytes in JS (avoiding BigInt in the hot path)
 * and written to WASM memory only for the `nextMatch` call.
 */
export { GEAR_TABLE } from "./table.js";
export declare class Hasher {
    private readonly maskBytes;
    /**
     * The current 64-bit rolling hash state as 8 little-endian bytes.
     * Updated after every `nextMatch` call. Zeroed by `resetHash()`.
     */
    readonly hash: Uint8Array;
    constructor(mask: bigint);
    /**
     * Scan `buf` for the next gear-hash match. The internal hash state
     * carries over between calls (for split-buffer scanning).
     *
     * @returns 1-based byte position of the match, or -1 if none found.
     */
    nextMatch(buf: Uint8Array): number;
    /** Reset rolling hash to zero (call when starting a new chunk). */
    resetHash(): void;
}
//# sourceMappingURL=index.d.ts.map