Documentation ¶
Index ¶
- Constants
- func CheckDecode(blob []byte) ([]byte, byte, error)
- func CheckEncode(b []byte, ver byte) string
- func Checksum(blob []byte) (checksum [ChecksumSize]byte)
- func Decode(blob []byte) ([]byte, error)
- func DecodeString(s string) ([]byte, error)
- func Encode(blob []byte) []byte
- func EncodeToString(b []byte) string
- func ErrChecksumMismatch() error
- func ErrInvalidFormat() error
- func ErrUnknownFormat() error
Constants ¶
View Source
const ( // ChecksumSize is a size of checksum in bytes. ChecksumSize = 4 // VersionSize is a size of version in bytes. VersionSize = 1 )
View Source
const ( ErrChecksumMismatchMsg = "checksum mismatch" ErrInvalidFormatMsg = "invalid format" ErrUnknownFormatMsg = "unknown format" )
View Source
const (
// Alphabet is the modified base58 alphabet.
Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
)
Variables ¶
This section is empty.
Functions ¶
func CheckDecode ¶
CheckDecode decodes a string that was encoded with CheckEncode and verifies the checksum.
func CheckEncode ¶
CheckEncode prepends a version byte and appends a four byte checksum.
func Checksum ¶
func Checksum(blob []byte) (checksum [ChecksumSize]byte)
Checksum returns first of ChecksumSize bytes of SHA256 double-hash over provided bytes.
func DecodeString ¶
DecodeString decodes base58 encoded string to bytes.
func EncodeToString ¶
EncodeToString encodes given bytes to base58 encoded string.
func ErrChecksumMismatch ¶
func ErrChecksumMismatch() error
func ErrInvalidFormat ¶
func ErrInvalidFormat() error
func ErrUnknownFormat ¶
func ErrUnknownFormat() error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.