Crates.io | bisection_key |
lib.rs | bisection_key |
version | 0.0.1 |
source | src |
created_at | 2021-12-16 04:37:28.991754 |
updated_at | 2021-12-16 04:37:28.991754 |
description | lexiographic fractional index key algorithm |
homepage | https://github.com/Cumulo/bisection-key.rs/ |
repository | https://github.com/Cumulo/bisection-key.rs/ |
max_upload_size | |
id | 499017 |
size | 30,001 |
insert between two different keys infinitely.
Charset:
+-/0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
numeral repersentation: 0
~ 64
, middle size is 32
, corresponding to T
.
LexiconKey
is in lexicographic order:
use bisection_key::{LexiconKey}
let k0 = LexiconKey::default(); // defaults to "T"
k0.bisect_beginning()
k0.bisect_end()
let k1 = LexiconKey::new("a").unwrap();
b0.bisect(&k1)
BalancedKey
is a different attempt, like said, it's balanced around T
like "balanced ternary" and has its own implementation of Ord
trait:
use bisection_key::{BalancedKey}
let k0 = LexiconKey::default(); // defaults to "T"
k0.bisect_beginning()
k0.bisect_end()
let k1 = LexiconKey::new("a").unwrap();
b0.bisect(&k1)
MIT