3 releases
new 0.1.3 | Dec 16, 2024 |
---|---|
0.1.2 | Dec 13, 2024 |
0.1.1 | Dec 13, 2024 |
#35 in #mapping
193 downloads per month
9KB
132 lines
bytes-inverse
A Rust library that provides order-inverting mapping for bytes. It transforms input bytes while preserving their ordinal relationships in reverse order.
- For any input bytes a and b where a < b, the mapping guarantees map(a) > map(b).
- For any input bytes a, the mapping guarantees unmap(map(a)) = a.
Usage
let e = bytes_inverse::map(b"");
let a = bytes_inverse::map(b"a");
assert!(e > a);
let b = bytes_inverse::map(b"b");
assert!(e > b);
assert!(a > b);
let aa = bytes_inverse::map(b"aa");
assert!(e > aa);
assert!(a > aa);
assert!(aa > b);