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 state

Back to all declarations

Alphabet

untyped string

Alphabet is the Bitcoin Base58 alphabet.

Value

"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"

Encode

func(input []uint8) string

Encode converts a byte slice to its Base58 string representation. Algorithm: treat the input as a big base-256 integer and repeatedly convert it into base-58 digits via a carry loop, most-significant digit first. Each leading zero byte becomes a leading '1'.

Open
OID
070df9…16ae:3
Encode details

Inspect func

Decode

func(s string) []uint8

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.

Open
OID
070df9…16ae:5
Decode details

Inspect func

IsValid

func(s string) bool

IsValid reports whether every character of s belongs to the Base58 alphabet.

Open
OID
070df9…16ae:6
IsValid details

Inspect func

Render

func(path string) string

Render produces the gnoweb Markdown view. - "/" → the alphabet + a small gallery of worked examples. - "/\<hex>" → decode the hex input to bytes, show its Base58, and the hex-encoded decoded round-trip to prove Encode/Decode are inverse.

Open
OID
070df9…16ae:7
Render details

Inspect func

renderHex

func(arg string) string
Open
OID
070df9…16ae:9
renderHex details

Inspect func

byteList

func(b []uint8) string

byteList renders a byte slice as a compact space-separated hex list.

Open
OID
070df9…16ae:10
byteList details

Inspect func
Alphabet : untyped string ="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
Encode : func(input []uint8) string Inspect
Decode : func(s string) []uint8 Inspect
IsValid : func(s string) bool Inspect
Render : func(path string) string Inspect
renderHome : func() string Inspect
renderHex : func(arg string) string Inspect
byteList : func(b []uint8) string Inspect