Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/hashed/common/hasher.ts>Hasher.anyFlatHasher

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
function Hasher.anyFlatHasher
import { Hasher } from "https://deno.land/x/rimbu@1.0.4/hashed/common/hasher.ts";
const { anyFlatHasher } = Hasher;

Returns a Hasher instance that hashes any value, but never traverses into an object or array to hash its elements. In those cases it will use toString.

Examples

Example 1

const h = Hasher.anyFlatHasher()
console.log(h.hash({ a: 1, b: 2 }) === h.hash({ b: 2, a: 1 }))
// => false