decode
Decode base-N, URL, IDNA, bech32, or hexdump strings back to text or hex/base64 output for binary payloads.
Instructions
Decode a base-N/URL/IDNA/bech32/hexdump string back to bytes or text.
The inverse of encode over the same scheme set. The recovered bytes are
rendered per output_format (text=UTF-8 | hex=bare, no 0x | base64); pick
hex/base64 for binary payloads that are not valid UTF-8. options carries
alphabet for base58/base62. base58/base58check/base45/idna need the
encoding extra.
Returns {scheme, decoded, output_format}; bech32/bech32m additionally return
their hrp.
Example: decode("aGVsbG8=", "base64") -> decoded "hello"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Encoded string to decode, in `scheme`'s format. | |
| scheme | Yes | Source encoding (same set as `encode`): base16/32/.../64url, ascii85/base85/z85, url/url_form, idna, bech32/bech32m, hexdump, or bytes32. | |
| output_format | No | How recovered bytes are rendered: text=UTF-8, hex=bare (no 0x), base64. Default 'text'; pick hex/base64 for non-UTF-8 payloads. | text |
| options | No | Per-scheme options: alphabet (base58/base62). Default None. |