Documentation ¶
Index ¶
- func Base64Decode(b64 string) ([]byte, error)
- func Base64ToBytes(base64String string) ([]byte, error)
- func BytesToBase64(bytesArray []byte) string
- func BytesToUint32(b []byte) uint32
- func HexDecode(h string) ([]byte, error)
- func HexDecodeInto(dst []byte, h []byte) error
- func HexEncode(bs []byte) string
- func Uint32ToBytes(u uint32) []byte
- func UnmarshalJSONHexDecode(bs []byte) ([]byte, error)
- func UnmarshalJSONHexDecodeInto(dst []byte, bs []byte) error
- type Hex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64Decode ¶ added in v0.0.3
Base64Decode decodes a string in base64 with optional padding into an array of bytes.
func Base64ToBytes ¶
Base64ToBytes converts a base64 encoded string into array of bytes
func BytesToBase64 ¶
BytesToBase64 converts an array of bytes to a base64 encoded string
func BytesToUint32 ¶
BytesToUint32 returns a uint32 from a byte array
func HexDecodeInto ¶
HexDecodeInto decodes a hex string into an array of bytes (dst), verifying that the decoded array has the same length as dst.
func Uint32ToBytes ¶
Uint32ToBytes returns a byte array from a uint32
func UnmarshalJSONHexDecode ¶ added in v0.0.3
UnmarshalJSONHexDecode decodes the JSON Hex string and returns the []byte
func UnmarshalJSONHexDecodeInto ¶
UnmarshalJSONHexDecodeInto decodes the JSON Hex string into bs
Types ¶
type Hex ¶ added in v0.0.5
type Hex []byte
Hex is a byte slice type that can be marshalled and unmarshaled in hex
func (Hex) MarshalText ¶ added in v0.0.5
MarshalText encodes buf as hex
func (*Hex) UnmarshalText ¶ added in v0.0.5
UnmarshalText decodes a hex into buf