encode
Encode input data into any of 18 string formats including base64, hex dump, bech32, and IDNA. Configure padding and alphabet per scheme.
Instructions
Encode bytes/text into a string form (base-N, URL, IDNA, bech32, hexdump, bytes32).
data is decoded to bytes via input_format (text|hex|base64). options
is a per-scheme dict: padding (bool, default true — base32/base64 family),
alphabet (custom symbol set — base58/base62), hrp (required for
bech32/bech32m), width (bytes per line — hexdump, default 16). idna and
bytes32 read data as a text string / short string respectively. bytes32 is
a fixed-width 32-byte EVM word: inputs of <32 bytes are right-padded with
0x00; decode returns all 32 bytes (it does NOT strip trailing nulls, so the
round-trip is lossless — rstrip them yourself for a short string).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | ||
| scheme | Yes | ||
| input_format | No | text | |
| options | No |