std/encoding/hex
import "github.com/eugenioenko/goalchemy/std/encoding/hex"Package hex encodes and decodes hexadecimal strings.
var ErrLength = errors.New("encoding/hex: odd length hex string")ErrLength reports an odd-length input to Decode.
AppendDecode
Section titled “AppendDecode”func AppendDecode(dst, src []byte) ([]byte, error)AppendDecode appends the decoding of src to dst. On error it returns the bytes decoded before the error.
AppendEncode
Section titled “AppendEncode”func AppendEncode(dst, src []byte) []byteAppendEncode appends the hexadecimal encoding of src to dst.
Decode
Section titled “Decode”func Decode(dst, src []byte) (int, error)Decode decodes src into dst and returns the number of bytes written. It accepts upper and lower case digits.
DecodeString
Section titled “DecodeString”func DecodeString(s string) ([]byte, error)DecodeString returns the bytes represented by the hexadecimal string s.
DecodedLen
Section titled “DecodedLen”func DecodedLen(x int) intDecodedLen returns the length of a decoding of x source bytes.
Encode
Section titled “Encode”func Encode(dst, src []byte) intEncode writes the lowercase hexadecimal encoding of src into dst and returns EncodedLen(len(src)).
EncodeToString
Section titled “EncodeToString”func EncodeToString(src []byte) stringEncodeToString returns the lowercase hexadecimal encoding of src.
EncodedLen
Section titled “EncodedLen”func EncodedLen(n int) intEncodedLen returns the length of an encoding of n source bytes.
type InvalidByteError
Section titled “type InvalidByteError”type InvalidByteError byteInvalidByteError reports a byte that is not a hexadecimal digit.
InvalidByteError.Error
Section titled “InvalidByteError.Error”func (e InvalidByteError) Error() string