BECH32(3em)
πΈ NAME πΈ
okay so bestie, welcome to the bech32 page from the 3em manual section β it's the bech32 codec, and that's the entire name situation. periodt. π
β¨ SYNOPSIS β¨
First you pull in the module, like:
local bech32 = require 'bech32'
Then there are two segwit_encode forms, numbered and everything:
bech32.segwit_encode(output: byte_span, hrp: string, witver: integer, input: byte_span) -> byte_span (1)
bech32.segwit_encode(hrp: string, witver: integer, input: byte_span) -> string (2)
π DESCRIPTION π
okay so the whole mission is: encode a SegWit address. that's it, that's the vibe. π¦
output should have at least segwit_encode_output_length(hrp, input) bytes. like, give it the room it needs, no cap.
π¨ caveat time: hrp must be all-lower case. lowercase only, bestie β uppercase is not on the guest list. π
And what does it return? The slice of output that was used to encode the bech32 address. exactly that slice, iconic. π
kisses, this cutie came from Emilua 0.12.1 and is dated 1980-01-01 β BECH32(3em) forever π«Άπ
π¦ where this page comes from
- nixos 26.05: emilua-bech32 1.1.1
- nixpkgs unstable: emilua-bech32 1.1.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms