apps-script-utils 2.1.1 Help

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

value

unknown

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

src/lang/object/hashCode.ts

23 September 2026

This documentation was generated with AI (Claude) from the library's source code.