An IMEI generator and checker written for NodeJS using NPM. Uses a DB from tacdb.osmocom.org.
The module exposes a class IMEI_GenCheck(sure You name it on requiring), which is to be used
for constructing an actual object providing the features You can find below. Basically, the
object has features for IMEI generating and checking; exposes a comfortable interface to the TAC DB,
allowing to search through it. But to actually use the DB this way, You'll need to invoke loadDB()
method and wait for the returned Promise to resolve with the count of rows loaded into the DB property.
Enough of intro, just behold usage examples down there.
To use this, NPM is needed. Read about it whereever ya willing.
Usually npm install imei_gencheck must be enough.
This won't depend (i hope) on anything but:
"devDependencies" are kinda optional. You don't need them unless wanna check tested features working.
To just randomize an IMEI:
const IMEI_GenCheck = ;const imeigc = ;console;
(this is likely to give an actually non-existent number)
Here is the code to get the gencheck DB up:
const IMEI_GenCheck = ;const imeigc = ;imeigc;
And after the DB was put into RAM, some special functions become available. For example:
And let us get something useful. Like a random iPhone 7 Plus IMEI:
And with the 3.1 here came a possibility to search by fields set: findTACInfoByFields
const searchObj = name1: "Nokia" aka:"1112b";const strictSearch = false; // Searching with string's indexOf() method// FALSE is the default value. With TRUE the search will use === operator// (will perform toLowerCase() anyway tho)imeigc;
In the folder "data" there is the DB used by the code. When it gets loaded, it is put into an array
And here is how the data from each .csv row is stored in the objects inside the array:
let newTACinfo ="tac": line0"name1": line1"name2": line2"comment": line3"gsmarena1": line5"gsmarena2": line6"aka": line7"type": "" // Yep, there is no Type in the DB so far.;
To load from some other .csv file (which is now supported through a constructor parameter), You'll need to arrange the data accordingly or to change that code in index.js.
You can read the tests code in the file inside "test" directory. It pretty much sums up the possibilities and provides usage examples.
As of 4.0 (Not very much new from 1.0.0, though not compatible with that already):