BECH32(3em)
π BECH32(3em) π
okay so we're on the BECH32(3em) page, and the manual name is bech32 β it's literally the bech32 codec page, no cap. This is your bestie-approved vibe check for encoding Bech32/Bech32m strings, and the facts stay exactly where they belong. π«Άβ¨
π NAME π
bech32 β bech32 codec. That's the whole name-section moment, and it ate. π
β¨ SYNOPSIS β¨
Here's the group-chat screenshot of the API, verbatim and iconic:
local bech32 = require 'bech32'
bech32.encode(output: byte_span, hrp: string, input: byte_span, encoding_variant: "m"|nil) -> byte_span (1)
bech32.encode(hrp: string, input: byte_span, encoding_variant: "m"|nil) -> string (2)
so yeah: two overloads, numbered (1) and (2), and bech32.encode is the main character here. The first form returns a byte_span; the second returns a string. Lowkey straightforward, highkey useful. π
π DESCRIPTION π
The whole point: encode a Bech32 or Bech32m string. That's it, that's the vibe. β¨
outputshould have at leastencode_output_length(hrp, input)bytes. That's the size requirement, fr fr βoutputshould have at least that many bytes. πhrpmust be all-lower case. Periodt. π
β οΈ bestie, hrp must be all-lower case β that's a must, not a maybe. π
- Returns the slice of
outputthat was used to encode the bech32 address. So that's the exact chunk you get back, and it's iconic. β¨
okay that's the page, bestie. huge cute sign-off to the footer energy: Emilua 0.12.1, dated 1980-01-01 β iconic source/version and date, no cap. πβ¨π
π¦ 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