Documentation
¶
Overview ¶
Package crock32 provides an API for working with modified base32 and Base32Check encodings.
Modified base32 Encoding ...
Base32Check Encoding Scheme ¶
The Base32Check encoding scheme is primarily used for Bitcoin addresses at the time of this writing, however it can be used to generically encode arbitrary byte arrays into human-readable strings along with a version byte that can be used to differentiate the same payload. For Bitcoin addresses, the extra version is used to differentiate the network of otherwise identical public keys which helps prevent using an address intended for one network on another.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckDecode ¶
CheckDecode decodes a string that was encoded with CheckEncode and verifies the check byte
func CheckEncode ¶
func Decode ¶
Decode decodes a modified base32 string to a byte slice.
Example ¶
This example demonstrates how to decode modified base32 encoded data.
package main
import (
"fmt"
"github.com/ilius/crock32"
)
func main() {
// Decode example modified base32 encoded data.
encoded := "1A6AWVM41J62X31"
decoded, err := crock32.Decode(encoded)
if err != nil {
panic(err)
}
// Show the decoded data.
fmt.Println("Decoded Data:", string(decoded))
}
Output: Decoded Data: Test data
func Encode ¶
Encode encodes a byte slice to a modified base32 string.
Example ¶
This example demonstrates how to encode data using the modified base32 encoding scheme.
package main
import (
"fmt"
"github.com/ilius/crock32"
)
func main() {
// Encode example data with the modified base32 encoding scheme.
data := []byte("Test data")
encoded := crock32.Encode(data)
// Show the encoded data.
fmt.Println("Encoded Data:", encoded)
}
Output: Encoded Data: 1A6AWVM41J62X31
Types ¶
This section is empty.