Skip to content

ThinkDigitalSoftware/imei_validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages