A lightweight and zero-copy Rust crate for parsing and validating vehicle identification numbers (VINs) according to the ISO 3779 standard.

Features

Quickstart

Cargo.toml

[dependencies]
mb_vin = "0.8.0"

main.rs

use mb_vin::Vin;

fn main() -> Result<(), mb_vin::Error> {
    let vin_str = "5GZCZ43D13S812715";
    let vin = Vin::parse(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);
    }
    
    if let Some(year) = vin.year_of_manufacture() {
    	println!("Year: {}", year);
    }
    
    Ok(())

License

Copyright (c) 2025 murilo ijanc' <mbsd@m0x.ru>

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.