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

Function EncodeBytesDescending

pkg/util/encoding/encoding.go:698–704  ·  view source on GitHub ↗

EncodeBytesDescending encodes the []byte value using an escape-based encoding and then inverts (ones complement) the result so that it sorts in reverse order, from larger to smaller lexicographically.

(b []byte, data []byte)

Source from the content-addressed store, hash-verified

696// so that it sorts in reverse order, from larger to smaller
697// lexicographically.
698func EncodeBytesDescending(b []byte, data []byte) []byte {
699 n := len(b)
700 b = EncodeBytesAscending(b, data)
701 b[n] = bytesDescMarker
702 onesComplement(b[n+1:])
703 return b
704}
705
706// EncodeBytesSize returns the size of the []byte value when encoded using
707// EncodeBytes{Ascending,Descending}. The function accounts for the encoding

Callers 1

EncodeStringDescendingFunction · 0.85

Calls 2

EncodeBytesAscendingFunction · 0.85
onesComplementFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…