Skip to content

canonicalJSONHash

canonicalJSONHash(json, algorithm?) → string · JSON

Canonicalize JSON per RFC 8785 and compute a cryptographic hash of the result.

  • json (required): JSON string or UDM value

  • algorithm (optional, default "SHA-256"): hash algorithm

utlx
// See Chapter 24 for JSON processing.
{
  digest: canonicalJSONHash(renderJson($input)),
  digest512: canonicalJSONHash(renderJson($input), "SHA-512")
}

Released under AGPL-3.0.