mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-07-16 02:03:00 -07:00
Fix for swapped parity when using lf_bulk_program.lua (#591)
This commit is contained in:
parent
f5ecd97b15
commit
e069547c27
1 changed files with 22 additions and 21 deletions
|
@ -57,12 +57,13 @@ end
|
|||
local function cardHex(i,f)
|
||||
fac = bit32.lshift(f,16)
|
||||
id = bit32.bor(i, fac)
|
||||
stream=toBits(id,26)
|
||||
stream=toBits(id,24)
|
||||
|
||||
--As the function defaults to even parity and returns a boolean,
|
||||
--perform a 'not' function to get odd parity
|
||||
high = not evenparity(string.sub(stream,0,12)) and 1 or 0
|
||||
low = evenparity(string.sub(stream,13)) and 1 or 0
|
||||
high = evenparity(string.sub(stream,1,12)) and 1 or 0
|
||||
low = not evenparity(string.sub(stream,13)) and 1 or 0
|
||||
|
||||
bits = bit32.bor(bit32.lshift(id,1), low)
|
||||
bits = bit32.bor(bits, bit32.lshift(high,25))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue