namespace Hasher
Interface used to hash objects for hashed collections.
Companion interface: Hasher<UK>
Functions
anyDeepHasher
Returns a Hasher instance that hashes any value, and traverses into an object or array to hash its elements.
anyDeepHasher
anyFlatHasher
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.
anyFlatHasher
anyJsonStringHasher
Returns a Hasher instance that hashes any value by hashing the string resulting from applying JSON.stringify to the value.
anyJsonStringHasher
anyShallowHasher
Returns a Hasher instance that hashes any value, but only traverses into an object or array to hash its elements one level deep. After one level, it will use toString.
anyShallowHasher
anyToStringHasher
Returns a Hasher instance that hashes the string representation of any value
anyToStringHasher
arrayHasher
Returns a Hasher that hashes arrays of elements by sampling the array and using the given itemHasher
to hash the sampled elements.
arrayHasher
itemHasher
to hash the sampled elements.bigintHasher
Returns a Hasher instance that hashes bigints.
bigintHasher
booleanHasher
Returns a Hasher instance that hashes booleans.
booleanHasher
createValueOfHasher
Returns a Hasher instance that hashes the .valueOf
value of the given object using the given valueHasher
for instances of given cls
class.
createValueOfHasher
.valueOf
value of the given object using the given valueHasher
for instances of given cls
class.dateHasher
Returns a Hasher instance that hashes Dates.
dateHasher
defaultHasher
undocumented
defaultHasher
numberHasher
Returns a Hasher instance that hashes numbers, including 'special' values like NaN and infinities.
numberHasher
objectDeepHasher
Returns a Hasher instance that hashes objects of key type K and value type V. If a value if an object or array, it will recursively hash its values.
objectDeepHasher
objectHasher
Returns a Hasher instance that hashes objects of key type K and value type V.
objectHasher
objectShallowHasher
Returns a Hasher instance that hashes objects of key type K and value type V. If a value if an object or array, it will convert those values to a string.
objectShallowHasher
streamSourceHasher
Returns a Hasher instance that hashes any StreamSource limited to a certain amount of elements to prevent haning on infinite streams.
streamSourceHasher
stringCaseInsensitiveHasher
undocumented
stringCaseInsensitiveHasher
stringHasher
Returns a Hasher instance for string values.
stringHasher
tupleSymmetric
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.
tupleSymmetric
hasher
function to hash the tuple elements.