| Crates.io | nanoid-wasm |
| lib.rs | nanoid-wasm |
| version | 0.1.3 |
| created_at | 2025-03-07 12:14:16.889562+00 |
| updated_at | 2025-03-07 13:09:33.92814+00 |
| description | NanoId for wasm |
| homepage | |
| repository | https://github.com/acheul/nanoid-wasm |
| max_upload_size | |
| id | 1582841 |
| size | 5,723 |
# Cargo.toml
[dependencies]
nanoid-wasm = { path="../../nanoid-wasm", features=["not-wasm"] }
// in_your_rust.rs
use nanoid_wasm::nanoid;
let size = 21;
let id: String = nanoid!(); // 21 characters
println!("{}", id); // some random id with 21 characters;
let id: String = nanoid!(8); // 8 characters
println!("{}", id);
let id = nanoid!(5, &['a', 'b', 'c', 'd']); // 5 characters among ['a', 'b', 'c', 'd']
println!("{}", id);
There are only two features: wasm and not-wasm.
Default feature imports nothing. Must designate either of wasm or not-wasm.
https://acheul.github.io/nanoid-wasm/
js feature for wasm environment.