Documentation ¶
Index ¶
- Constants
- func DecodeBig(hexNum string) *big.Int
- func DecodeHex(str string) ([]byte, error)
- func DecodeNibble(in byte) uint64
- func DecodeString(str string) ([]byte, error)
- func DecodeUint64(str string) uint64
- func EncodeBig(bigint *big.Int) string
- func EncodeToHex(str []byte) string
- func EncodeToString(str []byte) string
- func EncodeUint64(i uint64) string
- func IsValid(s string) bool
- func MustDecodeHex(str string) []byte
- type DecError
Constants ¶
View Source
const ( // Base represents the hexadecimal base, which is 16 Base = 16 // BitSize64 64 bits BitSize64 = 64 )
View Source
const BadNibble = ^uint64(0)
BadNibble is a nibble that is bad
Variables ¶
This section is empty.
Functions ¶
func DecodeString ¶
DecodeString returns the byte representation of the hexadecimal string
func DecodeUint64 ¶
DecodeUint64 type-checks and converts a hex string to a uint64
func EncodeBig ¶
EncodeBig encodes bigint as a hex string with 0x prefix. The sign of the integer is ignored.
func EncodeToHex ¶
EncodeToHex generates a hex string based on the byte representation, with the '0x' prefix
func EncodeToString ¶
EncodeToString is a wrapper method for hex.EncodeToString
func EncodeUint64 ¶
EncodeUint64 encodes a number as a hex string with 0x prefix.
func MustDecodeHex ¶
MustDecodeHex type-checks and converts a hex string to a byte array
Types ¶
Click to show internal directories.
Click to hide internal directories.