BECH32(3em)
π NAME π
okay so this is BECH32(3em), and the star of the page is bech32 β bech32 codec. bestie, that's the whole name section, no cap. π
β¨ SYNOPSIS β¨
First you pull it in like this:
local bech32 = require 'bech32'
Then mb_encode shows up in two moods:
bech32.mb_encode(output: byte_span, input: byte_span) (1)
bech32.mb_encode(input: byte_span) -> byte_span (2)
π DESCRIPTION π
The vibe? Repack bits. That's the mission, periodt. π
It performs an 8bit-groups-to-5bit-groups conversion, and every group β whether it's a 5bit group or an 8bit group β gets encoded as a single byte. β¨
For the 5bit groups: they only use the lower bits of a byte. So the highest possible value in each byte for the 5bit-groups bytestream is 0x1F. π«Ά
For the 8bit groups: they concatenate the lower bits from consecutive byte-encoded 5bit groups to create each byte. And if padding is necessary? The value 0 gets used as padding. π§
π that's the whole page, bestie β sourced from Emilua 0.12.1, dated 1980-01-01. mwah! π
π¦ 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