{"uid":"cap_8h9EBkwIcyBmYqeUD3nOA","slug":"duo-data-utilities-cryptographic-hash-hmac-c7662618","name":"Duo Data Utilities – Cryptographic Hash & HMAC","description":"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.","url":"https://api.duoleads.com/v1/code/hash?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["algo","data"],"properties":{"out":{"enum":["hex","base64","base64url","base32"],"type":"string","default":"hex","maxLength":64,"description":"Digest output encoding: hex (default), base64, base64url or base32."},"algo":{"enum":["sha256","sha384","sha512","sha1","sha3-256","sha3-512","keccak256","blake2b-256","blake2b-512"],"type":"string","maxLength":64,"description":"Digest algorithm."},"data":{"type":"string","maxLength":8192,"description":"Input data, interpreted per encoding. At most 8192 characters. An empty value hashes the empty string."},"encoding":{"enum":["utf8","base64","base64url","hex"],"type":"string","default":"utf8","maxLength":64,"description":"Encoding of data: utf8 (default), base64, base64url or hex."},"hmac_key":{"type":"string","maxLength":512,"description":"If present, computes HMAC with this key."},"hmac_key_encoding":{"enum":["utf8","base64","base64url","hex"],"type":"string","default":"utf8","maxLength":64,"description":"Encoding of hmac_key, as encoding."}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["ok","route","version","data","meta"],"properties":{"ok":{"const":true},"data":{"type":"object","required":["digest","algo","out","input_bytes","hmac","bit_length"],"properties":{"out":{"type":"string"},"algo":{"type":"string"},"hmac":{"type":"boolean"},"digest":{"type":"string"},"bit_length":{"type":"integer"},"input_bytes":{"type":"integer"}}},"meta":{"type":"object","required":["request_id","computed_at","price_usd","deterministic","disclaimer"],"properties":{"sources":{"type":"array","items":{"type":"object","required":["id","version","published"]}},"price_usd":{"type":"string"},"disclaimer":{"type":"string"},"request_id":{"type":"string"},"computed_at":{"type":"string","description":"RFC 3339 UTC with milliseconds"},"deterministic":{"type":"boolean"}}},"route":{"const":"/v1/code/hash"},"version":{"type":"string"}}}}}}},"responseSchema":{"type":"json","example":{"ok":true,"data":{"out":"hex","algo":"sha256","hmac":false,"digest":"2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824","bit_length":256,"input_bytes":5},"meta":{"price_usd":"0.05","disclaimer":"Factual output of a deterministic computation over public data. Provided as is, with no warranty of accuracy, completeness or availability. Not investment, financial, legal, tax, medical or any other professional advice, and not a recommendation. Verify before relying on it. Terms: https://api.duoleads.com/terms","request_id":"01K6B7Q4ZC8H3F2M9WXR5TYN0D","computed_at":"2026-09-28T12:00:00.000Z","deterministic":true},"route":"/v1/code/hash","version":"1.0.0"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.05","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.05/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_RJfHUAiNDteui5Losc2x4","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.05","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes a cryptographic digest (SHA-256, SHA-384, SHA-512, SHA-1, SHA3-256, SHA3-512, Keccak-256, BLAKE2b-256, BLAKE2b-512) or HMAC of supplied data, returning the digest in a chosen output encoding.","exampleAgentPrompt":"Can you compute the SHA-256 hash of the text 'hello' and give me the result in hex?","exampleUseCases":[{"title":"Ethereum Keccak-256 address hashing","prompt":"Hash this hex-encoded byte string using Keccak-256 and return the result in hex — I need it for an Ethereum smart contract: 0x48656c6c6f"},{"title":"Webhook payload HMAC verification","prompt":"Compute an HMAC-SHA256 of the message 'order_id=42&status=paid' using my secret key 'mysecretkey' (UTF-8), and give me the digest in base64 so I can validate the webhook signature."},{"title":"File integrity checksum in base64url","prompt":"Give me the SHA-512 digest of this base64-encoded file content — 'SGVsbG8gV29ybGQ=' — encoded as base64url so I can embed it safely in a URL."}],"resultDescription":"Returns a JSON object with: the computed digest string (in the requested output encoding), the algorithm identifier used, a boolean indicating whether HMAC was applied, the byte length of the input, the bit length of the digest, plus metadata fields including request ID, computation timestamp, price in USD, and a determinism flag.","failureModes":["Missing required 'algo' or 'data' query parameters returns a 400 error","Input data exceeding 8192 characters is rejected","Unsupported algorithm value returns a validation error","Invalid encoding value for 'encoding' or 'hmac_key_encoding' returns a 400 error","HMAC key exceeding 512 characters is rejected","Payment failure (x402) if USDC balance is insufficient or payment header is missing"],"whenToPreferThis":"Choose this endpoint when you need a deterministic cryptographic hash or HMAC of a text or binary payload and want to specify the exact algorithm (including modern options like SHA3, Keccak-256 for Ethereum, or BLAKE2b) and output encoding (hex, base64, base64url, base32) in a single API call. It is ideal for agents that need integrity checks, signature verification prep, or blockchain-compatible hashing without running local crypto libraries.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T00:44:14.373Z","isFirstParty":false,"canonicalSlug":"duo-data-utilities-cryptographic-hash-hmac-c7662618"}