MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / DecodeUint32Ascending

Function DecodeUint32Ascending

pkg/util/encoding/encoding.go:243–249  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

241// the input as a big-endian 4 byte uint32 representation. The remainder
242// of the input buffer and the decoded uint32 are returned.
243func 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.

Callers 10

DecodeFunction · 0.92
decodeJEntryFunction · 0.92
DecodeJSONFunction · 0.92
formatEncodedJSONFunction · 0.92
DecodeTSVectorFunction · 0.92
DecodeTSVectorPGBinaryFunction · 0.92
DecodeTSQueryFunction · 0.92
DecodeTSQueryPGBinaryFunction · 0.92
DecodeUint32DescendingFunction · 0.85

Calls 2

ErrorfMethod · 0.80
Uint32Method · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…