Skip to main content
Version: v0.0.8

Function: unkeyedHash()

unkeyedHash(value): string

A plain, unsalted SHA-256 digest - NON-CONFORMING to §164.514(c) and never used by the engine. It is re-identifiable for a small, enumerable identifier space (an attacker hashes every candidate and matches). Exported solely so the test suite can prove the reversibility hazard the keyed path avoids. Do not use this to de-identify anything.

Parameters

value

string

The value to hash.

Returns

string

The lowercase-hex SHA-256 of value - reversible for a small input space.

Example

import { unkeyedHash } from "@cosyte/deid";

// Deterministic and unsalted - this is the footgun, shown so tests can assert against it.
unkeyedHash("a") === unkeyedHash("a"); // => true