PathrockNetwork Gno Explorer
HomeBlocksTransactionsTokensRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

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

Realm
Open in gnoweb ↗

Overview

Kind
Realm (renderable)
Name
v0
Namespace
moul / x / daily / b58demo
Files
3 (README)(gnomod.toml)
Exported functions
1
Module
gno.land/r/moul/x/daily/b58demo/v0
gno
0.9

Files (3)

  • README.mdmarkdown
  • gnomod.tomltoml
  • b58demo.gnogno

Select a file to view its exact on-chain source. Sorted README → gnomod → sources → tests.

Functions

  • Render(path string) string

Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.

Rendered

RenderedRawgnoweb ↗
# Base58 (Bitcoin alphabet)

Demo of the [`p/moul/x/daily/b58`](/p/moul/x/daily/b58/v0) 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) | hex | Base58 |
|---|---|---|
| `(empty)` | `(empty)` | `` |
| `hello world` | `68656c6c6f20776f726c64` | `StV1DL6CwTryKyV` |
| `gno.land` | `676e6f2e6c616e64` | `JJR1f4BQc9H` |
| `Bitcoin` | `426974636f696e` | `3WyEDWjcVB` |

Leading zero bytes → leading `1`s:

| bytes | Base58 |
|---|---|
| `[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`

vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.