[−][src]Module rksuid::rksuid
Module for creating, representing and transforming K-Sortable UIDs as described by Segment.io
Examples
use ::rksuid::rksuid; use ::rksuid::rksuid::Ksuid; let ksuid: Ksuid = rksuid::new(None, None); let serialized: String = ksuid.serialize(); let ksuid_2: Ksuid = rksuid::deserialize(&serialized);
Structs
Ksuid | K-Sortable Unique ID |
RngTypeIter |
Enums
RngType | RNG Types supported for payload creation, ChaCha8 is the default |
Constants
ALPHABET | Base62 Alphabet which preserves lexigraphic sorting |
Functions
deserialize | creates new ksuid from base62 encoded string serialized representation |
gen_epoch | Returns a Chrono::DateTime |
gen_payload | Returns a pseudo-random u128 for use as payload of a new Ksuid Optionally accepts an RngType instead of default ChaCha8 |
new | Creates new Ksuid with optionally specified timestamp and payload |
to_std_epoch | Convert a u32 timestamp from a Ksuid.timestamp into DateTime |