Base32
Utility functions for working with Base32 values using the BIP-173 bech32 alphabet.
Examples
Below are some examples demonstrating common usages of the Base32 module:
Encoding to Base32
import { Base32 } from 'ox'
const value = Base32.fromHex('0x00ff00')Decoding Base32
import { Base32 } from 'ox'
const value = Base32.toBytes('qrlsq')Functions
| Name | Description |
|---|---|
Base32.fromBytes | Encodes a Bytes.Bytes value to a Base32-encoded string (using the BIP-173 bech32 alphabet). |
Base32.fromHex | Encodes a Hex.Hex value to a Base32-encoded string (using the BIP-173 bech32 alphabet). |
Base32.toBytes | Decodes a Base32-encoded string (using the BIP-173 bech32 alphabet) to Bytes.Bytes. |
Base32.toHex | Decodes a Base32-encoded string (using the BIP-173 bech32 alphabet) to Hex.Hex. |
Errors
| Name | Description |
|---|---|
Base32.InvalidCharacterError | Thrown when a Base32 string contains an invalid character. |

