import { Hasher } from "https://deno.land/x/rimbu@0.13.1/core/main/exports.ts";
const { createValueOfHasher } = Hasher;
Returns a Hasher instance that hashes the .valueOf
value of the given
object using the given valueHasher
for instances of given cls
class.
Examples
Example 1
Example 1
const h = Hasher.createValueOfHasher(Date)
console.log(h.isValid(new Boolean(true)))
// => false
const d1 = new Date()
const d2 = new Date(d1)
console.log(h.hash(d1) === h.hash(d2))
// => true
Type Parameters
T extends { valueOf(): V; }