IRollingHash
Defined in: rolling/rolling-hash.ts:10
Shared contract for every incremental/rolling hash in this package: state
mutates as a byte window slides past, and a long-lived instance is pushed one
byte at a time — unlike the rest of this package’s one-shot (data) => digest functions. Nothing beyond push/value is guaranteed across every
implementation (Gear hash has no fixed window), so nothing else is on this
interface; windowed implementations (Buzhash, Rabin fingerprint, Rabin-Karp)
each additionally expose their own readonly windowSize: number.
Type Parameters
Section titled “Type Parameters”R extends number | bigint = number
Properties
Section titled “Properties”
readonlyvalue:R
Defined in: rolling/rolling-hash.ts:12
The rolling hash’s current value.
Methods
Section titled “Methods”push()
Section titled “push()”push(
byteIn):R
Defined in: rolling/rolling-hash.ts:21
Feeds one more byte into the window, returning the updated value.
Complexity: O(1).
Parameters
Section titled “Parameters”byteIn
Section titled “byteIn”number
The next byte, 0-255.
Returns
Section titled “Returns”R