+
+ <script>
+ var dictionary = {}
+ function add(commaSeparated)
+ {
+ var fields = commaSeparated.split(",");
+ var manufacturerCode = fields[0];
+ var modelCode = fields[1];
+ var modelSubCode= fields[2];
+ var modelName = fields[3];
+ var ATQA = fields[4];
+ var SAK = fields[5];
+
+ //In the data below, wrong endian is used. Mifare is
+ // written as "0004" instead of "0400", so we need to
+ // flip it
+ ATQA = ATQA.substr(2,4)+ATQA.substr(0,2)
+
+ var info = {
+ modelCode : modelCode,
+ modelSubCode : modelSubCode,
+ modelName : modelName,
+ ATQA : ATQA,
+ SAK : SAK
+ }
+ console.log("Adding "+modelName+" , "+SAK)
+
+ dictionary[ATQA] = dictionary[ATQA] || [];
+ dictionary[ATQA].push(info)
+ }
+ function lookup(atqa, sak)
+ {
+ if (!dictionary[atqa]) return "UNKNOWN";
+
+ var possibleMatches = [];
+ for(var i = 0 ; i < dictionary[atqa].length ; i++)
+ {
+
+ var info = dictionary[atqa][i];
+ console.log("Comparing "+sak+ " with "+ info.SAK);
+ if(sak && info.SAK == sak)//exact match
+ {
+ return info.modelName;
+// possibleMatches.push(info.modelName);
+ }else //SAK unknown
+ {
+ possibleMatches.push(info.modelName);
+ }
+ }
+ if(possibleMatches.length > 0)
+ return possibleMatches.join(" or ");
+ return "UNKNOWN"
+ }
+
+ add("04,,,Mifare TNP3xxx Activision 1K,0f01,01");
+ add("04,,,Mifare Mini,0004,09");
+ add("04,,,Mifare Classic 1k/Mifare Plus(4 byte UID) 2K SL1,0004,08");
+ add("04,,,Mifare Plus (4 byte UID) 2K SL2,0004,10");
+ add("04,,,Mifare Plus (4 byte UID) 4K SL2,0004,11");
+ add("04,,,Mifare Plus (4 byte UID) 4K SL1,0004,18");
+ add("04,,,Mifare Plus (4 byte UID) 2K/4K SL3,0004,20");
+ add("04,,,Mifare Classic 4K,0002,18");
+ add("xx,,,NDEF Tags,0044,00 ");
+ add("04,,,Mifare Ultralight/UltralightC,0044,04");
+ add("04,,,Mifare Plus (7 byte UID) 2K SL1,0042,08");
+ add("04,,,Mifare Plus (7 byte UID) 2K SL1,0044,08");
+ add("04,,,Mifare Plus (7 byte UID) 4K SL1,0042,18");
+ add("04,,,Mifare Plus (7 byte UID) 4K SL1,0044,18");
+ add("04,,,Mifare Plus (7 byte UID),0042,10");
+ add("04,,,Mifare Plus (7 byte UID),0044,10");
+ add("04,,,Mifare Plus (7 byte UID),0042,11");
+ add("04,,,Mifare Plus (7 byte UID),0044,11");
+ add("04,,,Mifare Plus (7 byte UID),0042,20");
+ add("04,,,Mifare Plus (7 byte UID),0044,20");
+ add("04,,,Mifare DesFire / DesFire EV1,0344,20067577810280");
+ add("04,,,JCOP31,0304,283877B14A434F503331");
+ add("04,,,JCOP31 v2.4.1,0048,207877B1024A434F5076323431");
+ add("04,,,JCOP41 v2.2,0048,203833B14A434F503431563232");
+ add("04,,,JCOP41 v2.3.1,0004,283833B14A434F50343156323331");
+ add("05,,,Mifare Classic 1K,0004,88");
+ add("40,,,MPCOS,0002,98");
+ add("25,,,Topaz/Topaz512/Jewel,0C00,");
+ add("1D,,,FM1208SH01,0004,53");
+ add("1D,,,FM1208,0008,20");
+ add("Nokia,,,Mifare Classic 4K emulated by Nokia 6212,0002,38");
+ add("Nokia,,,Mifare Classic 4K emulated by Nokia 6131,0008,38");
+ add("04,,,Smart MX with Mifare 4K emulation,0002");
+ add("04,,,Smart MX with Mifare 4K emulation,0102");
+ add("04,,,Smart MX with Mifare 4K emulation,0202");
+ add("04,,,Smart MX with Mifare 4K emulation,0302");
+ add("04,,,Smart MX with Mifare 4K emulation,0402");
+ add("04,,,Smart MX with Mifare 4K emulation,0502");
+ add("04,,,Smart MX with Mifare 4K emulation,0602");
+ add("04,,,Smart MX with Mifare 4K emulation,0702");
+ add("04,,,Smart MX with Mifare 4K emulation,0802");
+ add("04,,,Smart MX with Mifare 4K emulation,0902");
+ add("04,,,Smart MX with Mifare 4K emulation,0A02");
+ add("04,,,Smart MX with Mifare 4K emulation,0B02");
+ add("04,,,Smart MX with Mifare 4K emulation,0C02");
+ add("04,,,Smart MX with Mifare 4K emulation,0D02");
+ add("04,,,Smart MX with Mifare 4K emulation,0E02");
+ add("04,,,Smart MX with Mifare 4K emulation,0F02");
+ add("04,,,Smart MX with Mifare 1K emulation,0004");
+ add("04,,,Smart MX with Mifare 1K emulation,0104");
+ add("04,,,Smart MX with Mifare 1K emulation,0204");
+ add("04,,,Smart MX with Mifare 1K emulation,0304");
+ add("04,,,Smart MX with Mifare 1K emulation,0404");
+ add("04,,,Smart MX with Mifare 1K emulation,0504");
+ add("04,,,Smart MX with Mifare 1K emulation,0604");
+ add("04,,,Smart MX with Mifare 1K emulation,0704");
+ add("04,,,Smart MX with Mifare 1K emulation,0804");
+ add("04,,,Smart MX with Mifare 1K emulation,0904");
+ add("04,,,Smart MX with Mifare 1K emulation,0A04");
+ add("04,,,Smart MX with Mifare 1K emulation,0B04");
+ add("04,,,Smart MX with Mifare 1K emulation,0C04");
+ add("04,,,Smart MX with Mifare 1K emulation,0D04");
+ add("04,,,Smart MX with Mifare 1K emulation,0E04");
+ add("04,,,Smart MX with Mifare 1K emulation,0F04");
+ add("04,,,Smart MX with 7 byte UID,0048");
+ add("04,,,Smart MX with 7 byte UID,0148");
+ add("04,,,Smart MX with 7 byte UID,0248");
+ add("04,,,Smart MX with 7 byte UID,0348");
+ add("04,,,Smart MX with 7 byte UID,0448");
+ add("04,,,Smart MX with 7 byte UID,0548");
+ add("04,,,Smart MX with 7 byte UID,0648");
+ add("04,,,Smart MX with 7 byte UID,0748");
+ add("04,,,Smart MX with 7 byte UID,0848");
+ add("04,,,Smart MX with 7 byte UID,0948");
+ add("04,,,Smart MX with 7 byte UID,0A48");
+ add("04,,,Smart MX with 7 byte UID,0B48");
+ add("04,,,Smart MX with 7 byte UID,0C48");
+ add("04,,,Smart MX with 7 byte UID,0D48");
+ add("04,,,Smart MX with 7 byte UID,0E48");
+ add("04,,,Smart MX with 7 byte UID,0F48");
+ </script>
+