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

base58 package

Overview

Package base58 ports the core of Bitcoin's Base58 codec (à la mr-tron/base58 and btcutil/base58) to a gno.land realm.

Base58 is a base conversion from base-256 (raw bytes) to base-58 using an alphabet that omits the visually ambiguous characters 0 (zero), O (capital o), I (capital i) and l (lower L). The conversion here is done with pure byte-slice math — the classic div/mod-by-58 carry loop — so it needs no math/big. Leading zero bytes map to leading '1' characters and back, exactly like the reference implementations.

Function

Decode

func Decode(s string) []byte

Decode converts a Base58 string back to the original byte slice. It returns nil if the string contains a character outside the alphabet.

Algorithm: the mirror of Encode — treat the string as a big base-58 integer and convert it back to base-256 bytes with a carry loop. Each leading '1' becomes a leading zero byte.

Param

Command

gnokey query vm/qeval -remote "https://rpc.topaz.testnets.gno.land" -data "gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/base58.Decode()"

Result