pull/3/head
Jack 2017-12-08 14:43:08 +01:00 zatwierdzone przez GitHub
rodzic e78b93ecb9
commit fb71ea3198
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -82,8 +82,8 @@ NfcKey.prototype = (function () {
var tohex = function (b, l) { var tohex = function (b, l) {
var h = b.toString(16).toUpperCase(); var h = b.toString(16).toUpperCase();
if (h.length % 2 !== 0) while (l && h.length < l / 4)
return '0' + h; h = '0' + h;
return h; return h;
}; };
@ -108,7 +108,7 @@ NfcKey.prototype = (function () {
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
intKey = transfUid[i + offset] + ((intKey << 8) >>> 0); intKey = transfUid[i + offset] + ((intKey << 8) >>> 0);
return tohex(swap32(intKey)); return tohex(swap32(intKey), 32);
}, },
getPack: function (uid) { getPack: function (uid) {
@ -128,7 +128,7 @@ NfcKey.prototype = (function () {
intPack += transfUid[i] * 13; intPack += transfUid[i] * 13;
var res = ((intPack ^ 0x5555) >>> 0) & 0xFFFF; var res = ((intPack ^ 0x5555) >>> 0) & 0xFFFF;
return tohex(swap16(res)); return tohex(swap16(res), 16);
} }
}; };