bdk_chain::bitcoin::bech32

Function encode_to_fmt

pub fn encode_to_fmt<Ck, W>(
    fmt: &mut W,
    hrp: Hrp,
    data: &[u8],
) -> Result<(), EncodeError>
where Ck: Checksum, W: Write,
Expand description

Encodes data to a writer (fmt::Write) as a lowercase bech32 encoded string.

Encoded string will be prefixed with the hrp and have a checksum appended as specified by the Ck algorithm (NoChecksum to exclude checksum all together).