| Crates.io | vds |
| lib.rs | vds |
| version | 1.0.3 |
| created_at | 2025-05-19 21:57:42.006503+00 |
| updated_at | 2025-05-20 12:22:53.603346+00 |
| description | Visibly distinguishable string types for identifiers and codes. |
| homepage | |
| repository | https://github.com/ianwillis98/vds |
| max_upload_size | |
| id | 1680471 |
| size | 40,071 |
Visibly Distinguishable Strings โ a #![no_std] Rust crate for creating and validating string identifiers composed of easily readable characters.
This crate helps you generate and work with strings that:
O, 0, I, 1Install via Cargo:
cargo add vds
Enable optional features:
serde โ enables Serialize/Deserialize for VDChar and VDStringgenerate โ adds a builder for random string generation using rand_core[dependencies]
vds = { version = "1.0", features = ["generate", "serde"] }
VDCharA single, clearly readable character from a curated set.
use vds::VDChar;
assert!(VDChar::new('A').is_some());
assert!(VDChar::new('O').is_none()); // O is excluded
VDStringA validated string composed of VDChars. Acts like &str and supports .parse(), indexing, and iteration.
use vds::VDString;
let code: VDString = "AB29XY".parse().unwrap();
assert_eq!(&*code, "AB29XY");
VDGenerator (requires generate feature)A builder for generating readable strings with optional constraints:
use vds::VDGenerator;
use rand::SeedableRng;
let mut rng = rand::rngs::SmallRng::seed_from_u64(123);
let code = VDGenerator::new()
.length(8)
.no_repeats()
.no_adjacent_repeats()
.generate(&mut rng)
.unwrap();
This repo includes a .cargo/config.toml file with helpful aliases:
cargo docs โ build and open full-featured docscargo tests โ run the full test suite with all featurescargo checks โ check build with no default featurescargo builds โ build with all features enabledstd requiredLicensed under either of: