Skip to main content

computeStridedArrayHash

computeStridedArrayHash(array, offset, length, stride, elementHash, [elementHashContext]) ⇒ number

Useful for computing hashes of large arrays, can pick a relevant stride and skip large chunks of memory while still capturing good amount of unique information from evenly-spaced areas of the array

Kind: global function

ParamType
arrayArray.<T> | Uint32Array | Uint16Array | Uint8Array
offsetnumber
lengthnumber
stridenumber
elementHashfunction
[elementHashContext]*

computeStridedArrayHash~hash : number

Simple hashing scheme, multiplying existing hash by a prime and adding next value (h<<5) - h === h*31

Kind: inner property of computeStridedArrayHash