Merge pull request #578 from Tom5ive/master

fix for swapped parity bits
This commit is contained in:
Iceman 2018-02-22 14:08:33 +01:00 committed by GitHub
commit c50e55a4a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -61,8 +61,8 @@ local function cardHex(i,f)
--As the function defaults to even parity and returns a boolean,
--perform a 'not' function to get odd parity
high = evenparity(string.sub(stream,0,12)) and 1 or 0
low = not evenparity(string.sub(stream,13)) and 1 or 0
high = not evenparity(string.sub(stream,0,12)) and 1 or 0
low = 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))