document manual hash generation

Elia Marcinkiewicz 2024-03-06 21:00:29 +01:00
parent b3fd037cd9
commit ad5cd4c820
1 changed files with 16 additions and 0 deletions

View File

@ -24,6 +24,22 @@ PN532: No response from PN532!
## scanning new cards with a phone app
get a phone with nfc and the "nfc tools" app installed, scan card, look for "serial number", get first four bytes of that, use following code:
# assumes card serial number 0x13121337 and pin 2137
import hashlib
def generate_hash(card_uid, pin):
card_uid = bytes(reversed(card_uid[:4])).hex()
s = "{:08x}:{}".format(int(pin), card_uid)
return hash
## syncing data from LDAP
big TODO; currently, you need to: