Documentation ¶
Index ¶
- Constants
- func ArrayByteFloat(bs []byte) (result []float32)
- func BitLen(x int64) (n int64)
- func ByteArray2UInt64(bs []byte) uint64
- func ByteToFloat32(bytes []byte) float32
- func ByteToString(b []byte) string
- func FloatArray(fa []float32) (code string, err error)
- func FloatArrayByte(fa []float32) (code []byte, err error)
- func FormatByte(s uint64) string
- func FormatIByte(s uint64) string
- func StringToByte(s string) []byte
- func Uint64ToByte(fa uint64) []byte
- func UnsafeFloat32SliceAsByteSlice(floats []float32) []byte
- func ValueToByte(fa interface{}) ([]byte, error)
Constants ¶
View Source
const ( Byte = 1 << (iota * 10) KB MB GB TB PB EB )
IEC Sizes.
View Source
const ( IByte = 1 IKB = IByte * 1000 IMB = IKB * 1000 IGB = IMB * 1000 ITB = IGB * 1000 IPB = ITB * 1000 IEB = IPB * 1000 )
SI Sizes.
Variables ¶
This section is empty.
Functions ¶
func ArrayByteFloat ¶
func ByteArray2UInt64 ¶
func ByteToFloat32 ¶
func ByteToString ¶
ByteToString convert bytes to string Note: string and slice share a block of memory, for scenarios where slice does not change
func FloatArray ¶
func FloatArrayByte ¶
func FormatByte ¶
FormatByte convert uint64 to human-readable byte strings
func FormatIByte ¶
FormatIByte convert uint64 to human-readable byte strings
func StringToByte ¶
StringToByte convert string to bytes Note: string and slice share a block of memory, for scenarios where slice does not change
func Uint64ToByte ¶
func UnsafeFloat32SliceAsByteSlice ¶
Returns a slice of the bytes of the provided float64 slice. This allows highly performant access to large float64 slices for such things as computing hashes or simply writing the bytes to a file. BEWARE: this also means this []byte _is platform dependent_.
func ValueToByte ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.