(n uint64)
| 127 | } |
| 128 | |
| 129 | func uintToBytes(n uint64) []byte { |
| 130 | buf := new(bytes.Buffer) |
| 131 | err := binary.Write(buf, binary.BigEndian, n) |
| 132 | |
| 133 | if err != nil { |
| 134 | log.Fatalf("binary.Write failed: %v", err) |
| 135 | } |
| 136 | |
| 137 | return buf.Bytes() |
| 138 | } |
| 139 | |
| 140 | func padToX(b []byte, n uint) ([]byte, error) { |
| 141 | if len(b) > int(n) { |