Crates.io | mb_vin |
lib.rs | mb_vin |
version | 0.8.0 |
created_at | 2025-05-22 13:48:29.28303+00 |
updated_at | 2025-05-22 13:48:29.28303+00 |
description | A zero-copy parsing and validating vehicle identification numbers (VINs). |
homepage | https://mb-vin.microbio.rs |
repository | https://git.sr.ht/~microbio/mb-vin |
max_upload_size | |
id | 1685144 |
size | 92,922 |
A lightweight and zero-copy Rust crate for parsing and validating Vehicle Identification Numbers (VINs) according to the ISO 3779 standard.
serde
support with serialization and deserializationsimd
to fast batch parseAdd to your Cargo.toml
:
mb_vin = "0.8.0"
use mb_vin::{Vin, Error};
fn main() -> Result<(), Error> {
let vin_str = "5GZCZ43D13S812715";
let vin = Vin::parse_str(vin_str)?;
println!("WMI: {}", vin.wmi());
println!("VDS: {}", vin.vds());
println!("VIS: {}", vin.vis());
println!("Check digit: {}", vin.check_digit());
if let Some(info) = vin.lookup_wmi_info() {
println!("Country: {}", info.country);
println!("Manufacturer: {}", info.manufacturer);
println!("Region: {}", info.region);
}
if let Some(year) = vin.year_of_manufacture() {
println!("Year: {}", year);
}
Ok(())
}
Licensed under an OpenBSD-ISC-style license, see LICENSE for details.