BECH32(3em)

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

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