Documentation
¶
Index ¶
- func BigInt2BytesLe(z []byte, x *big.Int)
- func BigInt2Uint64Le(z []uint64, x *big.Int)
- func BytesBe2Uint64Le(x []byte) []uint64
- func BytesLe2BigInt(x []byte) *big.Int
- func BytesLe2Hex(x []byte) string
- func MarshalBinary(v cryptobyte.MarshalingValue) ([]byte, error)
- func MarshalBinaryLen(v cryptobyte.MarshalingValue, length uint) ([]byte, error)
- func Uint64Le2BigInt(x []uint64) *big.Int
- func Uint64Le2BytesBe(x []uint64) []byte
- func Uint64Le2BytesLe(x []uint64) []byte
- func Uint64Le2Hex(x []uint64) string
- func UnmarshalBinary(v UnmarshalingValue, data []byte) (err error)
- type UnmarshalingValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BigInt2BytesLe ¶
BigInt2BytesLe stores a positive big.Int number x into a little-endian slice z. The slice is modified if the bitlength of x <= 8*len(z) (padding with zeros). If x does not fit in the slice or is negative, z is not modified.
func BigInt2Uint64Le ¶
BigInt2Uint64Le stores a positive big.Int number x into a little-endian slice z. The slice is modified if the bitlength of x <= 8*len(z) (padding with zeros). If x does not fit in the slice or is negative, z is not modified.
func BytesBe2Uint64Le ¶ added in v1.1.0
BytesBe2Uint64Le converts a big-endian slice x to a little-endian slice of uint64.
func BytesLe2BigInt ¶
BytesLe2BigInt converts a little-endian slice x into a big-endian math/big.Int.
func BytesLe2Hex ¶
BytesLe2Hex returns an hexadecimal string of a number stored in a little-endian order slice x.
func MarshalBinary ¶ added in v1.6.0
func MarshalBinary(v cryptobyte.MarshalingValue) ([]byte, error)
MarshalBinary encodes a value into a byte array in a format readable by UnmarshalBinary.
func MarshalBinaryLen ¶ added in v1.6.0
func MarshalBinaryLen(v cryptobyte.MarshalingValue, length uint) ([]byte, error)
MarshalBinaryLen encodes a value into an array of n bytes in a format readable by UnmarshalBinary.
func Uint64Le2BigInt ¶
Uint64Le2BigInt converts a little-endian slice x into a big number.
func Uint64Le2BytesBe ¶ added in v1.1.0
Uint64Le2BytesBe converts a little-endian slice x to a big-endian slice of bytes.
func Uint64Le2BytesLe ¶ added in v1.1.0
Uint64Le2BytesLe converts a little-endian slice x to a little-endian slice of bytes.
func Uint64Le2Hex ¶ added in v1.1.0
Uint64Le2Hex returns an hexadecimal string of a number stored in a little-endian order slice x.
func UnmarshalBinary ¶ added in v1.6.0
func UnmarshalBinary(v UnmarshalingValue, data []byte) (err error)
UnmarshalBinary recovers a value from a byte array. It returns an error if the read was unsuccessful.
Types ¶
type UnmarshalingValue ¶ added in v1.6.0
type UnmarshalingValue interface {
Unmarshal(*cryptobyte.String) bool
}
A UnmarshalingValue decodes itself from a cryptobyte.String and advances the pointer. It reports whether the read was successful.