Crate lexicoid

source ·
Expand description

lexicoid

Short & stable IDs based on timestamps.

Heavily inspired by Short, friendly base32 slugs from timestamps by @brandur.

Quickstart

// generates a lexicoid for the current timestamp
println!("{}", lexicoid_now()); // gj7x3vc

// generates a lexicoid for a given unix timestamp (as u64)
println!("{}", lexicoid(1654401676)); // gei4p52

Structs

A lexicographically sortable identifier generated from a unix timestamp.

Functions

Generates a lexicoid for a given unix timestamp (as u64).
Generates a lexicoid for the current timestamp (using the system time).