toolkit-mcp-server: hash value
toolkit_hash_valueGenerate or verify cryptographic digests (SHA-256, SHA-512, MD5, SHA-1) with constant-time comparison for checksum validation. Supports UTF-8, hex, or base64 input.
Instructions
Generate a cryptographic digest of a value, or verify a value against an expected digest. Set operation to "generate" for a lowercase-hex digest, or "compare" to constant-time-check value against the expected digest — compare is timing-safe and avoids manual string equality checks. Algorithm defaults to sha256; sha512 is also secure, while md5 and sha1 are exposed for checksum and file-integrity compatibility ONLY and must not be used for passwords, signatures, or any security purpose. inputEncoding controls how value and expected are read before hashing (utf8 default, or hex/base64 for raw binary data) so binary blobs need no decode round-trip. The canonical use is matching a download against a vendor-published checksum.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| value | Yes | The data to hash, interpreted per inputEncoding (raw text by default). | |
| expected | No | The expected lowercase-hex digest to compare against. Required when operation is "compare". | |
| algorithm | No | Digest algorithm. sha256 (default) or sha512 for security; md5/sha1 are checksum/compat only — not for security. | sha256 |
| operation | No | "generate" produces a digest; "compare" constant-time-checks value against expected. | generate |
| inputEncoding | No | How value (and expected's pre-image, when relevant) is decoded before hashing: utf8 text, hex, or base64. | utf8 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Present when the call failed. Absent on success. | |
| digest | No | Lowercase-hex digest of value. Present for operation "generate". | |
| matches | No | Constant-time equality of the computed digest against expected. Present for operation "compare". | |
| algorithm | No | The algorithm used. | |
| operation | No | The operation performed. | |
| lengthInBytes | No | Digest size in bytes (32 for sha256, 64 for sha512, 20 for sha1, 16 for md5). Present for "generate". |