Skip to main content

Module bytes

Module bytes 

Source
Expand description

Fractional order keys as bytes: base-256 fractions where a midpoint always exists between two distinct keys, compared as fractions (trailing zeros are insignificant). The compact form rich-text documents store per paragraph; see the parent module for the string form collections use.

Functions§

between
Produce a key ordered strictly between lo and hi (either may be None for “before everything” / “after everything”).
between_salted
A key strictly between lo and hi that differs with salt, so two replicas inserting into the same gap at once, each with its own salt, almost always get distinct keys, and a later insert fits between them.
cmp
Compare two keys as base-256 fractions (missing/trailing digits are 0).