Crates.io | nano-id |
lib.rs | nano-id |
version | 0.4.0 |
source | src |
created_at | 2021-04-06 18:33:04.312411 |
updated_at | 2024-06-02 22:29:57.341488 |
description | A tiny, secure, URL-friendly, unique string ID generator for Rust |
homepage | |
repository | https://github.com/viz-rs/nano-id |
max_upload_size | |
id | 379953 |
size | 20,190 |
A tiny, secure, URL-friendly, unique string ID generator for Rust
Inspired by nanoid
ModueSymbhaswnPr123456789ABCDEFGHNRVfgctiUvzKqYTJkLxpZXjQW
, (123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz
)ModuleSymbhasOwnPr0123456789ABCDEFGHNRVfgctiUvzKqYTJkLxpZXIjQW
, (A-Za-z0-9
)ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW
, (A-Za-z0-9_-
)gen!(uid, 64, b"_-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
cargo add nano-id
nano_id::base64::<21>();
// Custom ALPHABET
nano_id::gen!(
uid,
64,
b"_-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
);
uid::<21>();