deterministic
no-api-key
code
crypto
hashing

Hash generator: SHA-256, SHA-512, SHA-3, Keccak-256, BLAKE2 and HMAC digests

Hash generator: compute a cryptographic digest of supplied data: SHA-256, SHA-384, SHA-512, SHA-1, SHA3-256, SHA3-512, Keccak-256, BLAKE2b-256 and BLAKE2b-512, plus HMAC with any of them. Input is UTF-8 text, base64 or hex bytes; output is hex, base64, base64url or base32. Returns the digest, the byte length of the input, and the exact algorithm identifier used.

Output (data): digest, algo, out, input_bytes, hmac (boolean), bit_length.

Deterministic: identical input returns identical output, so the response is served with Cache-Control: private, max-age=31536000, immutable (the paying client may cache it indefinitely; shared caches must not, because the response is paid).

Price: $0.05 USDC per call (x402, Base). Route contract version 1.0.0. Docs: https://api.duoleads.com/docs#code-hash

get/v1/code/hash

Request

  • Base URL: https://api.duoleads.com
  • URL: https://api.duoleads.com/v1/code/hash
  • Auth: none declared

Query parameters

algo'sha256' | 'sha384' | 'sha512' | 'sha1' | 'sha3-256' | 'sha3-512' | 'keccak256' | 'blake2b-256' | 'blake2b-512' required

Digest algorithm. Accepted: sha256, sha384, sha512, sha1, sha3-256, sha3-512, keccak256, blake2b-256, blake2b-512.

datastring required

Input data, interpreted per encoding. At most 8192 characters. An empty value hashes the empty string. Accepted: at most 8192 characters.

encoding'utf8' | 'base64' | 'base64url' | 'hex'

Encoding of data: utf8 (default), base64, base64url or hex. Accepted: utf8, base64, base64url, hex.

out'hex' | 'base64' | 'base64url' | 'base32'

Digest output encoding: hex (default), base64, base64url or base32. Accepted: hex, base64, base64url, base32.

hmac_keystring

If present, computes HMAC with this key. Accepted: at most 512 characters.

hmac_key_encoding'utf8' | 'base64' | 'base64url' | 'hex'

Encoding of hmac_key, as encoding. Accepted: utf8, base64, base64url, hex.

Response

Paid and settled. data is route-specific; a route that judges its input returns 200 with data.valid: false for a bad value.

okunknown required
route'/v1/code/hash' required
version'1.0.0' required

Changes

No recorded changes to this operation across all 1 revision of this API.