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)
| 143 | // representation at the specified index, lengthening the input slice if |
| 144 | // necessary. |
| 145 | func PutUint32Ascending(b []byte, v uint32, idx int) []byte { |
| 146 | for len(b) < idx+4 { |
| 147 | b = append(b, 0) |
| 148 | } |
| 149 | b[idx] = byte(v >> 24) |
| 150 | b[idx+1] = byte(v >> 16) |
| 151 | b[idx+2] = byte(v >> 8) |
| 152 | b[idx+3] = byte(v) |
| 153 | return b |
| 154 | } |
| 155 | |
| 156 | // EncodeUint32Descending encodes the uint32 value so that it sorts in |
| 157 | // reverse order, from largest to smallest. |
no outgoing calls
no test coverage detected
searching dependent graphs…