Skip to content

B2MSolutions/node-imei

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-imei

Build Status

Description

node-imei is a helper module for IMEI validation and creation.

Installation

$ npm install imei

Usage

var imei = require('imei');

var IMEI = '352099001761481';
var isValid = imei.isValid(IMEI); // returns true

imei.next(IMEI, function(e, next) {
    console.log(next); // logs '352099001761499' (the next IMEI in the range)
});

isValid(IMEI)

Returns a boolean denoting whether the IMEI is valid see the standards. In practice this means a 15 digit number with a correct luhn digit.

next(prevIMEI, callback)

Yields the next valid IMEI after prevIMEI. You can use this method to iterate up through valid IMEIs. It yields an error if either the prevIMEI is invalid or you have come to the end of the TAC range.

Contributors

Pair programmed by Roy Lines and James Bloomer.

About

Utilities for dealing with IMEIs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published