Documentation
¶
Overview ¶
Package convert provides functions for type conversion.
Index ¶
- func BytesBEToUint16(data []byte) uint16
- func BytesBEToUint32(data []byte) uint32
- func BytesBEToUint64(data []byte) uint64
- func BytesLEToUint16(data []byte) uint16
- func BytesLEToUint32(data []byte) uint32
- func BytesLEToUint64(data []byte) uint64
- func BytesToUint8(data []byte) uint8
- func ToBool(v any) bool
- func ToBytes(v any) []byte
- func ToInteger(v any) int
- func ToString(v any) string
- func Uint8ToBytes(n uint8) []byte
- func Uint16ToBytesBE(n uint16) []byte
- func Uint16ToBytesLE(n uint16) []byte
- func Uint32ToBytesBE(n uint32) []byte
- func Uint32ToBytesLE(n uint32) []byte
- func Uint64ToBytesBE(n uint64) []byte
- func Uint64ToBytesLE(n uint64) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesBEToUint16 ¶
BytesBEToUint16 converts data in big-endian format to a uint16.
func BytesBEToUint32 ¶
BytesBEToUint32 converts data in big-endian format to a uint32.
func BytesBEToUint64 ¶
BytesBEToUint64 converts data in big-endian format to a uint64.
func BytesLEToUint16 ¶
BytesLEToUint16 converts data in little-endian format to a uint16.
func BytesLEToUint32 ¶
BytesLEToUint32 converts data in little-endian format to a uint32.
func BytesLEToUint64 ¶
BytesLEToUint64 converts data in little-endian format to a uint64.
func Uint8ToBytes ¶
Uint8ToBytes converts a uint8 to a fixed-length slice.
func Uint16ToBytesBE ¶
Uint16ToBytesBE converts a uint16 to a fixed-length slice.
func Uint16ToBytesLE ¶
Uint16ToBytesLE converts a uint16 to a fixed-length slice in little-endian format.
func Uint32ToBytesBE ¶
Uint32ToBytesBE converts a uint32 to a fixed-length slice in big-endian format.
func Uint32ToBytesLE ¶
Uint32ToBytesLE converts a uint32 to a fixed-length slice in little-endian format.
func Uint64ToBytesBE ¶
Uint64ToBytesBE converts a uint64 to a fixed-length slice in big-endian format.
func Uint64ToBytesLE ¶
Uint64ToBytesLE converts a uint64 to a fixed-length slice in little-endian format.
Types ¶
This section is empty.