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)
| 545 | // so that it sorts in reverse order, from larger to smaller |
| 546 | // lexicographically. |
| 547 | func 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 |
no test coverage detected
searching dependent graphs…