#numbers #parser #vehicle #identification #validation #vin #checksum

vin_parser

Vehicle Identification Number (VIN) parser and validator

1 stable release

1.0.0 Dec 21, 2022

#17 in #identification

Download history 42/week @ 2024-07-22 30/week @ 2024-07-29 20/week @ 2024-08-05 58/week @ 2024-08-12 46/week @ 2024-09-02 15/week @ 2024-09-09 31/week @ 2024-09-23 31/week @ 2024-09-30 18/week @ 2024-10-07 51/week @ 2024-10-14 54/week @ 2024-10-21 110/week @ 2024-10-28 35/week @ 2024-11-04

254 downloads per month

MIT license

34KB
828 lines

VIN

Build Status codecov License: MIT docs: latest

Vehicle Identification Number (VIN) parser and validator for Rust.

Provides information about region, manufacturer, country of origin, possible years of assembling and checksum validation of given Vehicle Identification Number.

Examples

Add dependency to your Cargo.toml

[dependencies]
vin = "1.0.0"

Then, in your crate:

extern crate vin;

let vin_number = "WP0ZZZ99ZTS392124";
assert!(vin::check_validity(vin_number).is_ok());
extern crate vin;

// Check VIN with checksum validation
let vin_number = "1M8GDM9AXKP042788";
assert!(vin::verify_checksum(vin).is_ok());
extern crate vin;

// Get VIN information
let vin_number = "wp0zzz998ts392124";
let result = vin::get_info(vin_number).unwrap();
assert_eq!(result.vin, vin_number.to_uppercase());
assert_eq!(result.country, "Germany/West Germany");
assert_eq!(result.manufacturer, "Porsche car");
assert_eq!(result.region, "Europe");
assert!(result.valid_checksum.is_ok());

Thanks

Inspired by this repository: https://github.com/idlesign/vininfo.

Dependencies

~10KB