(n int)
| 42 | } |
| 43 | |
| 44 | func IntToBytes(n int) []byte { |
| 45 | x := uint32(n) |
| 46 | bytesBuffer := bytes.NewBuffer([]byte{}) |
| 47 | binary.Write(bytesBuffer, binary.LittleEndian, x) |
| 48 | return bytesBuffer.Bytes() |
| 49 | } |
| 50 | |
| 51 | func UIntToBytes(x uint32) []byte { |
| 52 | bytesBuffer := bytes.NewBuffer([]byte{}) |