Skip to content

armgit / rea

Public Imported from GitHub
0

Reverse engineer anything with agents, from app behavior down to native binaries.

442 B
Raw Blame
import { digestCanonicalValue } from "./canonicalDigest.js";

/** Retain short exact string keys or commit their value in a reserved digest namespace. */
export const compactStringIdentityKey = (value: string): string => {
  const prefix = "value-sha256:";
  const digestKey = `${prefix}${digestCanonicalValue(value, "String identity")}`;
  return value.length <= digestKey.length && !value.startsWith(prefix)
    ? value
    : digestKey;
};