Crates.io | api_key |
lib.rs | api_key |
version | 0.1.0 |
source | src |
created_at | 2024-03-25 13:11:11.960226 |
updated_at | 2024-03-25 13:11:11.960226 |
description | Generate api key in rust supports base32, base62, string, uuid4, uuid5 |
homepage | |
repository | |
max_upload_size | |
id | 1185289 |
size | 24,799 |
A Rust utility for generating API keys including random strings, UUIDs, and keys based on specific encoding schemes like Base32 and Base62.
Rust port of https://github.com/pauldenver/generate-api-key
let options = StringGenerator {
prefix: String::from("PREFIX"),
..StringGenerator::default()
};
let key: ApiKeyResults = api_key::string(options);
assert!(match key {
ApiKeyResults::String(d) => d.starts_with("PREFIX"),
_ => false,
})