2 releases

0.1.1 Aug 19, 2024
0.1.0 Aug 2, 2023

#41 in #unique-id

Download history 2507/week @ 2024-07-29 2695/week @ 2024-08-05 3259/week @ 2024-08-12 2970/week @ 2024-08-19 2951/week @ 2024-08-26 2792/week @ 2024-09-02 2877/week @ 2024-09-09 2116/week @ 2024-09-16 2729/week @ 2024-09-23 2779/week @ 2024-09-30 2363/week @ 2024-10-07 3186/week @ 2024-10-14 2562/week @ 2024-10-21 2010/week @ 2024-10-28 1924/week @ 2024-11-04 1933/week @ 2024-11-11

8,636 downloads per month
Used in 21 crates (2 directly)

MIT license

6KB
55 lines

cuid-rust

Build Status Crates.io docs.rs

This repository is the home of the cuid and cuid2 crates. The original CUID standard is marked as deprecated in favor of CUID2, but we intent to continue supporting v1 CUIDs indefinitely, since their k-sortability is only insecure in specific use-cases, while their sortability is quite useful in other use-cases. cuid2 is provided as a separate crate because its generated IDs have different semantics from cuid, so it is not necessarily a drop-in replacement.

If you are using the cuid crate already, you can also use cuid2() and related functions from that crate.

Please see the individual crates' READMEs for more information.

Development

A flake.nix file is provided for easy installation of dependencies via the nix package manager. To start a shell with all of the dependencies available, run:

nix develop

Or, if you are not yet using flakes, a shell.nix shim is provided, so you can do the same with

nix-shell

If you use direnv, the .envrc file will automatically source the nix packages into your shell (or editor environment, if you use a direnv plugin).


lib.rs:

Common utility functions for CUID generation

No runtime deps