tinyid 1.0.0

A tiny ID type that's like UUID except shorter and easier for a user to type in.
Documentation

Rust coveralls.io codecov

TinyId

A small, 8-byte, ID type for use in rust applications that need a pretty unique identifier that is not required to be cryptographically secure / correct. They can be randomly generated but no work has been done to make sure that these random generations are secure (all RNG is done through the excellent fastrand crate).

I made this type because I needed mostly / somewhat random identifiers that could be easily read and retyped by a user, but would also prevent collisions in somewhat small (less than a million or so) applications.

Example

use tinyid::TinyId;

let mut id = TinyId::random();
assert!(id.is_valid());
assert!(!id.is_null());

id.make_null();
assert!(!id.is_valid());
assert!(id.is_null());
assert_eq!(id, TinyId::null());