bech32::Encode

Encode a Bech32 or Bech32m string. If hrp contains uppercase characters, this will cause an assertion error. Encoding must be one of BECH32 or BECH32M.

Synopsis

Declared in <bech32.h>

std::string
Encode(
    Encoding encoding,
    std::string const& hrp,
    std::vector<uint8_t> const& values);

Return Value

The encoded Bech32(m) string.

Parameters

NameDescription
encodingThe Bech32 variant to use (BECH32 or BECH32M).
hrpThe human-readable part; must be lowercase.
valuesThe base32 data payload to encode.