Expand description
Pure DOTNS encoding and decoding functions.
No I/O. No network calls. WASM-safe.
Provides ENS-style namehashing, ABI encoding, SCALE encoding/decoding, and contenthash → CID conversion for the DOTNS resolver protocol.
Re-exports§
pub use crate::hex_decode;pub use crate::hex_encode;
Constants§
- CONTENTHASH_
SELECTOR - Solidity function selector for
contenthash(bytes32).
Functions§
- base32_
encode - RFC 4648 base32 encoding (lowercase, no padding).
- contenthash_
to_ cid - Parse a contenthash value to extract an IPFS CIDv1.
- decode_
abi_ bytes - Decode ABI-encoded bytes return value from Solidity.
- decode_
contract_ result - Decode the SCALE-encoded
ContractResultfrom pallet-revive’sReviveApi::call. - decode_
scale_ compact - Decode a SCALE compact-encoded integer, returning (value, bytes_consumed).
- decode_
unsigned_ varint - Decode an unsigned varint (LEB128), returning (value, bytes_consumed).
- encode_
contenthash_ call - ABI-encode
contenthash(bytes32 node)call data. - hex_
addr - Compile-time hex string to 20-byte address.
- hex_
nibble - Compile-time hex character to nibble value.
- keccak256
- Compute keccak256 hash of the given data.
- namehash
- ENS-style namehash:
namehash("mytestapp.dot"). - scale_
compact_ len - SCALE compact encoding for a length prefix.
- scale_
compact_ u64 - SCALE compact encoding for a u64 value.
- scale_
encode_ revive_ call - SCALE-encode the parameters for
ReviveApi::call()runtime API.