Skip to main content
Module

x/rimbu/mod.ts>Hasher.tupleSymmetric

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

Returns a Hasher that will return equal hash values for values in a tuple regardless of their order, and uses the given hasher function to hash the tuple elements.

Examples

Example 1

const h = Hasher.tupleSymmetric()
console.log(h.hash(['abc', 'def']) === h.hash(['def', 'abc']))

Parameters

optional
hasher: Hasher<T> = [UNSUPPORTED]
  • the Hasher instance to use for tuple elements

Returns

Hasher<readonly [T, T]>