Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

v0 state

Back to all declarations

sample

untyped string

sample is a real mainnet address: human-readable part "g", 20 payload bytes.

Value

"g1manfred47kzduec920z88wfr64ylksmdcedlf5"

vectors

[][2]string (len=3)

The BIP-173 (Bech32) and BIP-350 (Bech32m) test vectors, paired by shape so the only difference on each row is the six-character checksum.

Open
OID
0ca0a0…b1fc:4
vectors details (len=3)

+3 more Inspect slice

extBase

untyped string

The insertion that Bech32 accepts and Bech32m refuses. Both strings below carry a checksum Bech32 verifies; only the second has the extra "q".

Value

"a1q3g6mnsp"

extInserted

untyped string

The insertion that Bech32 accepts and Bech32m refuses. Both strings below carry a checksum Bech32 verifies; only the second has the extra "q".

Value

"a1q3g6mnsqp"

extMBase

untyped string

The insertion that Bech32 accepts and Bech32m refuses. Both strings below carry a checksum Bech32 verifies; only the second has the extra "q".

Value

"a1q6dp699p"

extMInsert

untyped string

The insertion that Bech32 accepts and Bech32m refuses. Both strings below carry a checksum Bech32 verifies; only the second has the extra "q".

Value

"a1q6dp699qp"

Render

func(path string) string

Render renders the demo for gnoweb. Render("") / Render("/") -> the full demo Render("/<string>") -> decode that string

Open
OID
0ca0a0…b1fc:8
Render details

Inspect func

decodeOne

func(in string) string

decodeOne renders one string's decode. Everything derived from the input is escaped: the argument reaches this realm from whoever typed the url.

Open
OID
0ca0a0…b1fc:10
decodeOne details

Inspect func

hexOf

func(payload []uint8) string

hexOf renders a payload through the hexdump library, which owns the digits.

Open
OID
0ca0a0…b1fc:11
hexOf details

Inspect func

parseArg

func(path string) string

parseArg strips the one routing slash in front of the argument and returns the rest verbatim. Nothing else is removed: a slash is legal in a human-readable part, so cutting at one refuses a valid string, and trimming whitespace would render a clean decode of a string nobody typed.

Open
OID
0ca0a0…b1fc:12
parseArg details

Inspect func
sample : untyped string ="g1manfred47kzduec920z88wfr64ylksmdcedlf5"
vectors : [][2]string (len=3) Inspect
extBase : untyped string ="a1q3g6mnsp"
extInserted : untyped string ="a1q3g6mnsqp"
extMBase : untyped string ="a1q6dp699p"
extMInsert : untyped string ="a1q6dp699qp"
Render : func(path string) string Inspect
decodeOne : func(in string) string Inspect
hexOf : func(payload []uint8) string Inspect
parseArg : func(path string) string Inspect