POSTDetect hash

TON Mainnethttps://ton-mainnet.nodit.io/api/v2/detectHash
CU10

Validates a hash and returns it in all standard formats. Use this to convert between hex (64 chars) and base64 (44 chars) representations. Works with any 256-bit hash including transaction hashes, block hashes, and message hashes.

Request Body
hashstringrequired

Hash value to detect encoding formats for.

Responses
okbooleanrequired

Returns true if the request succeeded; otherwise false. See the error field for details.

@typestring (enum)required

TonLib type identifier for hash detection results. Refer to the TonLib type reference for a full list.

b64stringrequired

Hash in standard base64 encoding (44 characters, uses + and /).

b64urlstringrequired

Hash in URL-safe base64 encoding (44 characters, uses - and _ instead of + and /).

hexstringrequired

Hash in lowercase hexadecimal encoding (64 characters).

@extrastring

Optional request ID that can be passed in the request and received back in the response. Useful for matching async responses.

X-API-KEY
Request
cURL
curl -X POST "https://ton-mainnet.nodit.io/api/v2/detectHash" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "hash": "C7wzkIjnoos2+Ar+8AdwpZnDKY9PW59Ic1NwqQ1EWcU="
  }'
Response
Example · 200
{
  "ok": true,
  "result": {
    "@type": "ext.utils.detectedHash",
    "b64": "C7wzkIjnoos2+Ar+8AdwpZnDKY9PW59Ic1NwqQ1EWcU=",
    "b64url": "C7wzkIjnoos2-Ar-8AdwpZnDKY9PW59Ic1NwqQ1EWcU",
    "hex": "0bbc339088e7a28b36f80afef00770a599c3298f4f5b9f48735370a90d4459c5"
  },
  "@extra": "1795684389:_:0.021"
}