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)
| 241 | // the input as a big-endian 4 byte uint32 representation. The remainder |
| 242 | // of the input buffer and the decoded uint32 are returned. |
| 243 | func DecodeUint32Ascending(b []byte) ([]byte, uint32, error) { |
| 244 | if len(b) < 4 { |
| 245 | return nil, 0, errors.Errorf("insufficient bytes to decode uint32 int value") |
| 246 | } |
| 247 | v := binary.BigEndian.Uint32(b) |
| 248 | return b[4:], v, nil |
| 249 | } |
| 250 | |
| 251 | // DecodeUint32Descending decodes a uint32 value which was encoded |
| 252 | // using EncodeUint32Descending. |
no test coverage detected
searching dependent graphs…