For the latest stable version, please use Bech32 1.1!

bech32.segwit_decode

Synopsis

local bech32 = require 'bech32'

bech32.segwit_decode(output: byte_span, input: byte_span|string) -> string, integer, byte_span

Description

Decode a SegWit address.

output should have at least segwit_decode_output_length(input) bytes.

Returns a tuple with the following elements:

  • The lower-case version of the human-readable part.

  • The witness version.

  • The slice of output that was used to decode the bech32 address.