DecodeUint32Ascending decodes a uint32 from the input buffer, treating the input as a big-endian 4 byte uint32 representation. The remainder of the input buffer and the decoded uint32 are returned.
(b []byte)
| 163 | // the input as a big-endian 4 byte uint32 representation. The remainder |
| 164 | // of the input buffer and the decoded uint32 are returned. |
| 165 | func DecodeUint32Ascending(b []byte) ([]byte, uint32, error) { |
| 166 | if len(b) < 4 { |
| 167 | return nil, 0, errors.Errorf("insufficient bytes to decode uint32 int value") |
| 168 | } |
| 169 | v := binary.BigEndian.Uint32(b) |
| 170 | return b[4:], v, nil |
| 171 | } |
| 172 | |
| 173 | // DecodeUint32Descending decodes a uint32 value which was encoded |
| 174 | // using EncodeUint32Descending. |
no test coverage detected
searching dependent graphs…