Skip to content

crypto

Functions

hash()

function hash(input): string;

Hashes any JavaScript value into a deterministic string.

The value is serialized first and then hashed, which makes this helper useful for cache keys, content fingerprints, and change detection inside plugins.

This helper is not intended for password hashing or other security-sensitive cryptographic workflows.

Parameters

input

unknown

Any JavaScript value to hash.

Returns

string

A stable hash string for the provided input.

Example

hash({ foo: "bar" });
// returns a deterministic hash string such as "g82Nh7Lh3CUR..."

See

Powered by ohash (MIT): https://github.com/unjs/ohash