Go
Go
Base62 Encoding and Decoding
Demonstrates base62 encoding and decoding.Chilkat Go Downloads
bd := chilkat.NewBinData()
// Base62 encode.
bd.AppendString("hello world","utf-8")
base62_encoded := bd.GetEncoded("base62")
fmt.Println("hello world --> ", *base62_encoded)
// Output:
// hello world --> AAwf93rvy4aWQVw
// Base62 decode
sb := chilkat.NewStringBuilder()
sb.DecodeAndAppend("AAwf93rvy4aWQVw","base62","utf-8")
fmt.Println("decoded: ", *sb.GetAsString())
// Output:
// decoded: hello world
bd.DisposeBinData()
sb.DisposeStringBuilder()