8000 GitHub - MggMuggins/imei: An IMEI number validator implemented in Rust.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
forked from grantshandy/imei

An IMEI number validator implemented in Rust.

License

Notifications You must be signed in to change notification settings

MggMuggins/imei

 
 

Folders and files

NameName
La 8000 st commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

imei

An IMEI number validator implemented in Rust.

Add to Cargo.toml:

imei = "1.0.0"

Example

Basic example:

fn main() {
    let num = "490154203237518";
    let valid = imei::valid(num);

    println!("{num}: {valid}");
}

Result:

490154203237518: true

Speed

This validator is designed to be as fast and efficient as possible, it uses small number types, precalculates the character conversions and only iterates through the imei number once. The speed test in the tests directory gets the average speed of validation over 10,000,000 validations. On an AMD Ryzen 7 4700u, validation takes 3149 nanoseconds (0.003149 miliseconds).

About

An IMEI number validator implemented in Rust.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%
0