Realm

v1

gno.land/r/moul/x/daily/b58demo/v1

Render

Base58 (Bitcoin alphabet)

Demo of the p/moul/x/daily/b58 library — base conversion from raw bytes (base-256) to base-58, using the Bitcoin alphabet (no 0, O, I, l), pure byte-slice math, no math/big.

Alphabet

123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz

58 characters, index 0…57.

Examples

input (utf-8)hexBase58
(empty)(empty)``
hello world68656c6c6f20776f726c64StV1DL6CwTryKyV
gno.land676e6f2e6c616e64JJR1f4BQc9H
Bitcoin426974636f696e3WyEDWjcVB

Leading zero bytes → leading 1s:

bytesBase58
[0x00]1
[0x00 0x00 0x00]111

Try it

Append a hex string to the path to encode/round-trip it:

  • /68656c6c6f — the bytes for "hello"
  • /00000000 — four zero bytes
  • /deadbeef

Source (qfile)

README.md
b58demo.gno
gnomod.toml