PutUint32Ascending encodes the uint32 value using a big-endian 4 byte representation at the specified index, lengthening the input slice if necessary.
(b []byte, v uint32, idx int)
| 139 | // representation at the specified index, lengthening the input slice if |
| 140 | // necessary. |
| 141 | func PutUint32Ascending(b []byte, v uint32, idx int) []byte { |
| 142 | for len(b) < idx+4 { |
| 143 | b = append(b, 0) |
| 144 | } |
| 145 | b[idx] = byte(v >> 24) |
| 146 | b[idx+1] = byte(v >> 16) |
| 147 | b[idx+2] = byte(v >> 8) |
| 148 | b[idx+3] = byte(v) |
| 149 | return b |
| 150 | } |
| 151 | |
| 152 | // DecodeUint32Ascending decodes a uint32 from the input buffer, treating |
| 153 | // the input as a big-endian 4 byte uint32 representation. The remainder |
no outgoing calls
no test coverage detected