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

Function EncodeBytesDescending

pkg/util/encoding/encoding.go:547–553  ·  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

545// so that it sorts in reverse order, from larger to smaller
546// lexicographically.
547func EncodeBytesDescending(b []byte, data []byte) []byte {
548 n := len(b)
549 b = EncodeBytesAscending(b, data)
550 b[n] = bytesDescMarker
551 onesComplement(b[n+1:])
552 return b
553}
554
555// DecodeBytesAscending decodes a []byte value from the input buffer
556// which was encoded using EncodeBytesAscending. The decoded bytes

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…