Skip to main content

hash_sha512

Compute the SHA-512 (512-bit) hash of a UTF-8 string. Returns a 128-character lowercase hexadecimal digest.

SHA-512 provides a larger output size and a stronger security margin than SHA-256. Use it when maximum collision resistance is required.

Parameters​

ParameterTypeRequiredDescription
inputstringYesThe UTF-8 string to hash.

Response​

FieldTypeDescription
hashstringLowercase hexadecimal digest.

Examples​

Hash a non-empty string​

{
"input": "hello world"
}

Result:

{
"hash": "309ecc489c12d6eb4cc40f50c902f2b4d0ed77ee511a7c7a9bcd3ca86d4cd86f989dd35bc5ff499670da34255b45b0cfd830e81f605dcf7dc5542e93ae9cd76f"
}

Hash an empty string​

The SHA-512 digest of the empty string is a well-known constant and a useful baseline for verifying tool output:

{
"input": ""
}

Result:

{
"hash": "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e"
}

Errors​

Each failure carries a precise code in the response. Argument-schema and server errors are JSON-RPC protocol errors; a rejected value is returned as a tool result with isError: true (so the agent can read the code and self-correct).

CodeWhenDelivered as
invalid_argumentsThe input field is missing or not a string.protocol error (invalid_params)
internal_errorAn unexpected server error.protocol error (internal_error)

Notes​

  • The input is always treated as a UTF-8 string. If you need to hash raw bytes, hex-encode them first.
  • The digest is always 128 lowercase hex characters (512 bits).
  • SHA-512 output is deterministic — the same input always produces the same digest.