Documentation ¶
Index ¶
- func BytesToUint16(bytes []byte) uint16
- func BytesToUint32(bytes []byte) uint32
- func BytesToUint64(bytes []byte) uint64
- func BytesToUint8(bytes []byte) uint8
- func FormatBytes(bytes types.Uint128) string
- func GenerateRequestID() string
- func ShiftNBytes(numBytes uint, bytes []byte) ([]byte, []byte, error)
- func Uint16ToBytes(num uint16) []byte
- func Uint32ToBytes(num uint32) []byte
- func Uint64ToBytes(num uint64) []byte
- func Uint8ToBytes(num uint8) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToUint16 ¶ added in v0.4.0
BytesToUint16 returns uint16 from []byte if you have more than two bytes in your []byte this wont work like you think
func BytesToUint32 ¶ added in v0.4.0
BytesToUint32 returns uint32 from []byte if you have more than four bytes in your []byte this wont work like you think
func BytesToUint64 ¶ added in v0.4.0
BytesToUint64 returns uint64 from []byte if you have more than eight bytes in your []byte this wont work like you think
func BytesToUint8 ¶ added in v0.4.0
BytesToUint8 returns uint8 from []byte if you have more than one byte in your []byte this wont work like you think
func FormatBytes ¶
FormatBytes takes bytes as input and outputs a human friendly version
func GenerateRequestID ¶ added in v0.7.0
func GenerateRequestID() string
GenerateRequestID generates a random string to use as a request ID
func ShiftNBytes ¶ added in v0.4.0
ShiftNBytes returns the specified number of bytes from the start of the provided []byte and removes them from the original byte slice First returned value is the requested number of bytes from the beginning of the original byte slice Second returned value is the new original byte slice with the requested number of bytes removed from the front of it
func Uint16ToBytes ¶ added in v0.4.0
Uint16ToBytes Converts uint16 to []byte
func Uint32ToBytes ¶ added in v0.4.0
Uint32ToBytes Converts uint32 to []byte
func Uint64ToBytes ¶ added in v0.4.0
Uint64ToBytes Converts uint64 to []byte
func Uint8ToBytes ¶ added in v0.4.0
Uint8ToBytes Converts uint8 to []byte Kind of pointless, since byte is uint8, but here for consistency with the other methods
Types ¶
This section is empty.