Skip to main content

orderable_bytes/
lib.rs

1#![deny(missing_docs)]
2//! Canonical, order-preserving fixed-length byte encodings for plaintext
3//! types.
4//!
5//! Each module exposes a `to_orderable_bytes` function that maps a value of
6//! its target type to a fixed-length byte array whose byte-wise
7//! lexicographic order agrees with the type's natural total order, and
8//! whose byte equality agrees with the type's value equality. The
9//! resulting bytes are scheme-agnostic — they're intended for any
10//! comparison-as-bytes scheme that wants to preserve plaintext order on
11//! ciphertexts (e.g. `ore-rs` BlockORE, an OPE construction, an ordered
12//! hash).
13//!
14//! Encoders are gated behind per-type feature flags so callers only pay
15//! for the dependencies they actually use.
16
17#[cfg(feature = "chrono")]
18pub mod chrono;
19#[cfg(feature = "decimal")]
20pub mod decimal;
21
22#[cfg(test)]
23#[macro_use]
24extern crate quickcheck;