imei_validator 0.1.3

Dart native js
Flutter Android iOS web

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
85
pub points
62%
popularity

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

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

thinkdigitalrepair@gmail.com

License

BSD (LICENSE)

More

Packages that depend on imei_validator