You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

node-imei-ts

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-imei-ts

imei generator/checker fork from https://github.com/BadMachine/node-imei with added TS compatibility

1.0.11
latest
Source
npmnpm
Version published
Weekly downloads
6
Maintainers
1
Weekly downloads
 
Created
Source

node-imei

Description

imei generator/checker (via Luhn algorithm) forked from https://github.com/BadMachine/node-imei with minor changes made to make this package Typescript-compatible. Also added types definitions

Installation

$ npm install node-imei-ts

Usage

var imei = require('node-imei-ts');

console.log(IMEI.random()); // returns string with random imei

console.log(IMEI.device("Apple","iPhone3G")); // returns string with imei by device TAC

console.log(IMEI.isValid("860921035123120")); // returns true
export imei from 'node-imei-ts'

console.log(IMEI.random()); // returns string with random imei

console.log(IMEI.device("Apple","iPhone3G")); // returns string with imei by device TAC

console.log(IMEI.isValid("860921035123120")); // returns true

random()

Returns a string with valid imei. Script makes string with 3 parts: 1st part is TAC (Type Allocation Code) 2nd part is random value from 100000 to 999999 3rd part is last digit(Luhn digit)

isValid(imei)

Returns a boolean value.

Also

codes.js contains json object with Type Allocation Codes.

If you want to extend the file

Just add new TACs in codes.js More info and examples of TACs you can find at wiki or OSMOCOM direct link to download TACs db in json

License

MIT

Keywords

imei

FAQs

Package last updated on 15 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts