#identifier

ulys

a Universally Unique Lexicographically Sortable Identifier implementation, with a checksum

2 releases (1 stable)

31.0.0 Aug 7, 2024
0.1.0 Jul 24, 2024

#57 in #identifier

Download history 101/week @ 2024-07-22 9/week @ 2024-07-29 120/week @ 2024-08-05 4/week @ 2024-08-12 14/week @ 2024-09-16 8/week @ 2024-09-23 33/week @ 2024-09-30 8/week @ 2024-10-07 2/week @ 2024-10-14

51 downloads per month

MIT license

17KB
301 lines

ulys

Build Status Crates.io docs.rs

This lib is inspired from the Rust implementation of the ulid project which provides Universally Unique Lexicographically Sortable Identifiers.

Quickstart

use ulys::Ulys;

// Generate a ulys
let ulys = Ulys::new();

// Generate a string for a ulys
let s = ulys.to_string();

// Create from a String
let res = Ulys::from_string(&s);

assert_eq!(ulys, res.unwrap());

Crate Features

  • serde: Enables serialization and deserialization of Ulys types via serde. ULYSs are serialized using their canonical 26-character representation as defined in the ULID standard. An optional ulys_as_u128 module is provided, which enables serialization through an Ulys's inner u128 primitive type. See the documentation and serde docs for more information.
  • uuid: Implements infallible conversions between ULYSs and UUIDs from the uuid crate via the std::convert::From trait.

Dependencies

~0.4–1.1MB
~24K SLoC