mb_vin

Crates.iomb_vin
lib.rsmb_vin
version0.8.0
created_at2025-05-22 13:48:29.28303+00
updated_at2025-05-22 13:48:29.28303+00
descriptionA zero-copy parsing and validating vehicle identification numbers (VINs).
homepagehttps://mb-vin.microbio.rs
repositoryhttps://git.sr.ht/~microbio/mb-vin
max_upload_size
id1685144
size92,922
ijanc (murilobsd)

documentation

README

mb-vin

A lightweight and zero-copy Rust crate for parsing and validating Vehicle Identification Numbers (VINs) according to the ISO 3779 standard.

Features

  • Parse and validate (length, characters set, check digit).
  • Extract WMI (World Manufacturer Identifier), VDS, VIS.
  • Lookup manufacturer and country from WMI.
  • Infer manufacturing year from VIN
  • Optional serde support with serialization and deserialization
  • Optional simd to fast batch parse

Installation

Add to your Cargo.toml:

mb_vin = "0.8.0"

Usage

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(())
}

License

Licensed under an OpenBSD-ISC-style license, see LICENSE for details.

Commit count: 0

cargo fmt