BECH32(3em)

πŸ“¦ version 1.1.1, in nixos 26.05, nixpkgs unstable

πŸ’– 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. ✨

  • output should have at least encode_output_length(hrp, input) bytes. That's the size requirement, fr fr β€” output should have at least that many bytes. πŸ“
  • hrp must be all-lower case. Periodt. πŸ’…
⚠️ bestie, hrp must be all-lower case β€” that's a must, not a maybe. πŸ’€
  • Returns the slice of output that 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