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.
Add dependency to your Cargo.toml
[dependencies]
vin = "1.0.0"
Then, in your crate:
```rust
extern crate vin;
let vinnumber = "WP0ZZZ99ZTS392124"; assert!(vin::checkvalidity(vinnumber).isok()); ```
```rust extern crate vin;
// Check VIN with checksum validation let vinnumber = "1M8GDM9AXKP042788"; assert!(vin::verifychecksum(vin).is_ok()); ```
```rust extern crate vin;
// Get VIN information let vinnumber = "wp0zzz998ts392124"; let result = vin::getinfo(vinnumber).unwrap(); asserteq!(result.vin, vinnumber.touppercase()); asserteq!(result.country, "Germany/West Germany"); asserteq!(result.manufacturer, "Porsche car"); asserteq!(result.region, "Europe"); assert!(result.validchecksum.is_ok()); ```
Inspired by this repository: https://github.com/idlesign/vininfo.