hashCode
function hashCode(value: unknown): number;
The value is turned into a string first — an object through the key-sorted form stringifyJson produces — and the string is folded into a 32-bit integer. Two values that equals considers equal hash the same.
It is a bucket key, not a checksum: different values can collide, and the result is not stable across releases of the library.
Parameters
Parameter | Type | Description |
|---|---|---|
|
| The value to hash. |
Returns
number — a 32-bit integer; 0 for an empty string.
Examples
Hashing
hashCode("abc"); // => 96354
hashCode(""); // => 0
See also
Source
23 September 2026
This documentation was generated with AI (Claude) from the library's source code.