#id #unique-id #unique #identity #url #id-generator #database

minimal-id

A library that implements generating short, unique ids with minimal collisions and good locality

11 releases (7 breaking)

0.8.0 Jan 31, 2020
0.7.0 Sep 20, 2019
0.6.0 Sep 18, 2019
0.4.0 Jun 22, 2019

#1026 in Development tools

MIT license

14KB
259 lines

A library for generating random ids

Inspired by How Long Does An Id Need To Be, MinimalId is an Id generator that uses nine bytes to generate a mostly unique id with okay locality (to be proved)

Usage


use minimal_id::Generator;

let generator = Generator::default();
let id = generator.generate();
println!("Id: {}", id.to_string());

>>> Id: AAECAwQFBgcI

Dependencies

~0.4–2.2MB
~45K SLoC