For AI agents: the complete documentation index is available at /hclapi/llms.txt, the full documentation bundle is available at /hclapi/llms-full.txt, and this page is available as Markdown at /hclapi/docs/manifest/functions/cryptography/sha256.md.

sha256

Computes the SHA-256 cryptographic hash of a string, returning a lowercase 64-character hexadecimal digest.

Signature

sha256(str: string) -> string

Parameters

ParameterTypeRequiredDescription
strstringyesInput string

Return value

Returns the documented result for the function signature.

Example

redis "cache_query" {
  connection = connection.redis.cache
  command = "SET"
  key = "cache:query:${sha256(json_encode(ctx.request.body))}"
  value = json_encode(steps.db_query.result)
  ttl = "15m"
}