import { Hasher } from "https://deno.land/x/rimbu@1.0.4/hashed/common/hasher.ts";
const { streamSourceHasher } = Hasher;
Returns a Hasher instance that hashes any StreamSource limited to a certain amount of elements to prevent haning on infinite streams.
Examples
Example 1
Example 1
const h = Hasher.streamSourceHasher()
h.hash(Stream.random())
// infinite stream but will not hang due to the max step limit
Parameters
- (optional) an object containing the following items:
- itemHasher - (optional) a Hasher instance used to hash elements in the array
- maxStepBits - (optional) the amount of bits to determine the maximum amount of array elements to process