Skip to content

RabinFingerprint

Defined in: rolling/rabin-fingerprint.ts:41

Rabin fingerprint: a GF(2) polynomial-division rolling hash (Rabin, 1981), mathematically the same per-byte reduction as a non-reflected CRC (see _gf2-polynomial.ts), plus a sliding window — the departing byte’s contribution is precomputed per byte value at construction time (removalTable_[byte] = the fingerprint of byte followed by windowSize - 1 zero bytes) and XORed out before the incoming byte is folded in, following the same construction restic’s chunker package uses for content-defined chunking.

new RabinFingerprint(windowSize, options?): RabinFingerprint

Defined in: rolling/rabin-fingerprint.ts:52

number

RabinFingerprintOptions

RabinFingerprint

readonly windowSize: number

Defined in: rolling/rabin-fingerprint.ts:42

get value(): bigint

Defined in: rolling/rabin-fingerprint.ts:81

The rolling hash’s current value.

bigint

The rolling hash’s current value.

IRollingHash.value

push(byteIn): bigint

Defined in: rolling/rabin-fingerprint.ts:85

Feeds one more byte into the window, returning the updated value.

Complexity: O(1).

number

The next byte, 0-255.

bigint

IRollingHash.push