Documentation ¶
Index ¶
- Variables
- func Bytes2Hex(bytes []byte) string
- func Decode(input string) ([]byte, error)
- func DecodeBig(input string) (*big.Int, error)
- func DecodeHex(hex string) string
- func DecodeUint64(input string) (uint64, error)
- func Encode(b []byte) string
- func EncodeBig(bigint *big.Int) string
- func EncodeUint64(i uint64) string
- func Hex2BigInt(hex string) (*big.Int, error)
- func Hex2UInt64(hex string) (uint64, error)
- func MustDecode(input string) []byte
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmptyString = &decError{"empty hex string"} ErrSyntax = &decError{"invalid hex string"} ErrMissingPrefix = &decError{"hex string without 0x prefix"} ErrOddLength = &decError{"hex string of odd length"} ErrEmptyNumber = &decError{"hex string \"0x\""} ErrLeadingZero = &decError{"hex number with leading zero digits"} ErrUint64Range = &decError{"hex number > 64 bits"} ErrUintRange = &decError{fmt.Sprintf("hex number > %d bits", uintBits)} ErrBig256Range = &decError{"hex number > 256 bits"} )
Errors
Functions ¶
func DecodeBig ¶ added in v1.1.3
DecodeBig decodes a hex string with 0x prefix as a quantity. Numbers larger than 256 bits are not accepted.
func DecodeUint64 ¶ added in v1.1.3
DecodeUint64 decodes a hex string with 0x prefix as a quantity.
func EncodeBig ¶ added in v1.1.3
EncodeBig encodes bigint as a hex string with 0x prefix. The sign of the integer is ignored.
func EncodeUint64 ¶ added in v1.1.3
EncodeUint64 encodes i as a hex string with 0x prefix.
func Hex2UInt64 ¶ added in v1.0.5
Hex2UInt64 hex 2 uint64
func MustDecode ¶ added in v1.1.3
MustDecode decodes a hex string with 0x prefix. It panics for invalid input.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.