Documentation
¶
Overview ¶
This package implements hexadecimal encoding and decoding.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode decodes src into DecodedLen(len(src)) bytes, returning the actual number of bytes written to dst.
If Decode encounters invalid input, it returns an OddLengthInputError or an InvalidHexCharError.
func DecodeString ¶
DecodeString returns the bytes represented by the hexadecimal string s.
func DecodedLen ¶
func Encode ¶
Encode encodes src into EncodedLen(len(src)) bytes of dst. As a convenience, it returns the number of bytes written to dst, but this value is always EncodedLen(len(src)). Encode implements hexadecimal encoding.
func EncodeToString ¶
EncodeToString returns the hexadecimal encoding of src.
func EncodedLen ¶
EncodedLen returns the length of an encoding of n source bytes.
Types ¶
type InvalidHexCharError ¶
type InvalidHexCharError byte
InvalidHexCharError results from finding an invalid character in a hex string.
func (InvalidHexCharError) String ¶
func (e InvalidHexCharError) String() string
type OddLengthInputError ¶
type OddLengthInputError struct{}
OddLengthInputError results from decoding an odd length slice.
func (OddLengthInputError) String ¶
func (OddLengthInputError) String() string