bdk_chain::bitcoin::bech32::segwit

Function encoded_length

pub fn encoded_length(
    hrp: Hrp,
    _witness_version: Fe32,
    witness_program: &[u8],
) -> Result<usize, SegwitCodeLengthError>
Expand description

Returns the length of the address after encoding HRP, witness version and program.

ยงReturns

Ok(address_length) if the encoded address length is less than or equal to 90. Otherwise returns a SegwitCodeLengthError containing the encoded address length.