/**
 * Project-domain hashing helper.
 *
 * Originally part of a broader crypto-shim layer that included
 * `sha1Hex` / `sha256Hex` wrappers. Those have been inlined at their
 * call sites (one each, both trivial `createHash(...).update(...).digest('hex')`).
 *
 * `shortHash16` survives because it encodes a project-specific
 * decision: when we removed `Bun.hash.xxHash64` we needed a
 * deterministic 16-hex-character replacement that produces the same
 * string shape across runtimes. It's a SHA-256 truncation, but the
 * truncation policy itself is the value the helper provides — pulling
 * this into the call site would put a magic `.slice(0, 16)` in
 * `domain.ts` without context.
 *
 * One-time cache-invalidation note: keys generated by this function
 * will not match values previously generated by `Bun.hash.xxHash64`,
 * so any caches keyed by `shortHash16` carried over from before the
 * Node-compat work need to be cleared on first run.
 */
import { createHash } from 'node:crypto';
/**
 * Deterministic, 16-hex-character hash of a string. Backed by
 * SHA-256 truncated to the first 16 hex digits.
 *
 * Replaces previous calls of the form
 *   `Bun.hash.xxHash64(s).toString(16).padStart(16, '0')`
 * with a Node-portable computation that produces a string of the
 * same length and shape (16 lowercase hex chars).
 */
export function shortHash16(input) {
    return createHash('sha256').update(input).digest('hex').slice(0, 16);
}
//# sourceMappingURL=crypto.js.map