h4kbas / nfc-reader

A simple library that provides to use rfid card readers.
MIT License
128 stars 44 forks source link

How to convert UID to actual Id #10

Closed maqeelqureshi closed 3 years ago

maqeelqureshi commented 3 years ago

My card's NFC Id is 1082. When I scan it on https://whatwebcando.today/nfc.html on android phone it shows data = 10001082 When I use this library. NFC.GetCardUID returns 04eec4a2

I have checked chrome plugin (TagConneX) it passed 04EEC4A21C6880 to its web page.

How can I convert 04eec4a2 or 04EEC4A21C6880 to 10001082?

maqeelqureshi commented 3 years ago

I came to know that NFC.GetCardUID is for universal id of NFC card.

For data we need to read blocks (readblock command). NFC Tools android app was helpful which displayed the hex value of data. I compared this hex value to the values returned from all blocks (loop through all blocks using this library) and found the match on block-6.

I am not sure why this value is stored at block-6.