Expand description
§cuid-rust
CUID generation in rust
use cuid;
// Get a v1 CUID
println!("{}", cuid::cuid1().unwrap());
// Get a v2 CUID
println!("{}", cuid::cuid2());
Note that this crate also provides a very simple, single purpose commandline interface:
$> cuid
ckfritrvg0000kdtwc766fful
You can generate v2 CUIDs via the commandline like so:
$> cuid --v2
See the original v1 implementation and original v2 implementation for more details on CUIDs in general.
Structs§
- Cuid2
Constructor - Provides customization of CUID generation.
Enums§
- Cuid
Error - Errors for the CUID library
Functions§
- cuid
Deprecated - Generate a CUID
- cuid1
- Generate a v1 CUID
- cuid2
- Creates a new CUID.
- cuid1_
slug - Generate a CUID v1 slug
- cuid2_
slug - Creates a new CUID slug, which is just a CUID with a length of 10 characters.
- is_cuid
Deprecated - Return whether a string is a legitimate CUID
- is_
cuid1 - Return whether a string looks like it could be a legitimate CUID
- is_
cuid2 - Return whether a string is a legitimate CUID2
- is_
cuid1_ slug - Return whether a string looks like it could be a legitimate v1 CUID slug
- is_
cuid2_ slug - Return whether a string looks like it could be a legitimate CUID slug.
- is_slug
Deprecated - Return whether a string looks like it could be a legitimate CUID slug
- slug
Deprecated - Generate a CUID slug