14 lines
241 B
Go
14 lines
241 B
Go
package bytearray
|
|
|
|
import "encoding/binary"
|
|
|
|
func FromUInt64(input uint64) []byte {
|
|
b := make([]byte, 8)
|
|
binary.LittleEndian.PutUint64(b, input)
|
|
return b
|
|
}
|
|
|
|
func ToUInt64(input []byte) uint64 {
|
|
return binary.LittleEndian.Uint64(input)
|
|
}
|