Documentation ¶
Index ¶
- Constants
- Variables
- func BytesToFloat32(buf []byte, offset int) float32
- func BytesToFloat64(buf []byte, offset int) float64
- func BytesToHexString(buf []byte) string
- func BytesToInt16(buf []byte, offset int) int16
- func BytesToInt32(buf []byte, offset int) int32
- func BytesToInt64(buf []byte, offset int) int64
- func BytesToNumber(buf []byte, offset, length int) interface{}
- func BytesToUint16(buf []byte, offset int) uint16
- func BytesToUint32(buf []byte, offset int) uint32
- func Float32ToBytes(float float32, buffer []byte, offset int) []byte
- func Float64ToBytes(float float64, buffer []byte, offset int) []byte
- func GetUnsigned(b byte) int
- func Int16ToBytes(num int16, buffer []byte, offset int) []byte
- func Int32ToBytes(num int32, buffer []byte, offset int) []byte
- func Int64ToBytes(num int64, buffer []byte, offset int) []byte
- func LittleBytesToInt32(buf []byte, offset int) int32
- func Uint32ToBytes(num uint32, buffer []byte, offset int) []byte
- func VarBytesToInt64(buf []byte, offset int, len int) int64
Constants ¶
const ( SizeOfInt32 = uintptr(4) SizeOfInt64 = uintptr(8) )
Variables ¶
var Arch32Bits bool
var Arch64Bits bool
var SizeOfInt uintptr
Functions ¶
func BytesToFloat32 ¶ added in v1.0.2
func BytesToFloat64 ¶ added in v1.0.2
func BytesToHexString ¶
BytesToHexString converts a byte slice into a hex string
func BytesToInt16 ¶
BytesToInt16 converts a slice of bytes to an int16
func BytesToInt32 ¶
BytesToInt32 converts a slice into int32; only maximum of 4 bytes will be used
func BytesToInt64 ¶
BytesToInt64 converts a slice into int64; only maximum of 8 bytes will be used
func BytesToNumber ¶
BytesToNumber converts a slice of bytes into an integer with appropriate type
func BytesToUint16 ¶ added in v1.6.3
func BytesToUint32 ¶ added in v1.6.3
BytesToUint32 converts a slice into uint32; only maximum of 4 bytes will be used
func Float32ToBytes ¶ added in v1.0.2
func Float64ToBytes ¶ added in v1.0.2
func GetUnsigned ¶
func Int16ToBytes ¶
Int16ToBytes converts an int16 to slice of bytes
func Int32ToBytes ¶
Int32ToBytes converts an int32 to a byte slice of size 4
func Int64ToBytes ¶
Int64ToBytes converts an int64 into slice of Bytes.
func LittleBytesToInt32 ¶ added in v1.0.2
LittleBytesToInt32 converts a slice into int32; only maximum of 4 bytes will be used
func Uint32ToBytes ¶ added in v1.8.0
Uint32ToBytes converts an uint32 to a byte slice of size 4
Types ¶
This section is empty.