imei_validator 0.1.1 copy "imei_validator: ^0.1.1" to clipboard
imei_validator: ^0.1.1 copied to clipboard

outdatedDart 1 only

A library for checking cell phone IMEIs with the Luhn algorithm.

imei_validator #

imei_validator is a library for checking IMEIs using the Luhn algorithm.

Installing #

Add this to your package's pubspec.yaml file:

dependencies:
  imei_validator: any

If you're using the Dart Editor, choose:

Menu > Tools > Pub Install

Or if you want to install from the command line, run:

$ pub install

Now in your Dart code, you can use:

import 'package:imei_validator/imei_validator.dart';

Overview #

var imei = new ImeiValidator("378282246310005");
print(imei.isValid); // true

Note: imei_validator will automatically remove any space or dashes from the string passed to it

Check Digit #

You can calculate a check digit by creating a new ImeiValidator and passing in an meid (14 digits). The ImeiValidator will automatically calculate the check digit and make it available via the checkDigit getter.

var imei = new ImeiValidator("37828224631000");
print(imei.checkDigit); // 5
0
likes
0
pub points
50%
popularity

Publisher

unverified uploader

A library for checking cell phone IMEIs with the Luhn algorithm.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

More

Packages that depend on imei_validator