mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-09-21 15:56:21 +08:00
fix: 'script lf_bulk' - parity fixes (@pwpiwi)
This commit is contained in:
parent
d0b3f1311e
commit
089beed4f4
|
@ -107,12 +107,12 @@ end
|
||||||
local function cardHex(i, f)
|
local function cardHex(i, f)
|
||||||
fac = lshift(f, 16)
|
fac = lshift(f, 16)
|
||||||
id = bor(i, fac)
|
id = bor(i, fac)
|
||||||
stream = toBits(id, 26)
|
stream = toBits(id, 24)
|
||||||
|
|
||||||
--As the function defaults to even parity and returns a boolean,
|
--As the function defaults to even parity and returns a boolean,
|
||||||
--perform a 'not' function to get odd parity
|
--perform a 'not' function to get odd parity
|
||||||
high = not evenparity(string.sub(stream, 0, 12)) and 1 or 0
|
high = evenparity(string.sub(stream,1,12)) and 1 or 0
|
||||||
low = evenparity(string.sub(stream, 13)) and 1 or 0
|
low = not evenparity(string.sub(stream,13)) and 1 or 0
|
||||||
bits = bor( lshift(id, 1), low)
|
bits = bor( lshift(id, 1), low)
|
||||||
bits = bor( bits, lshift(high, 25))
|
bits = bor( bits, lshift(high, 25))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue