问题
I receive bytes from an RFID reader when presenting a card, but I'm unable to figure out how to derive the card ID from these bytes.
For example, I have a card that has these numbers printed on it: 0007625328 116,23152. I would expect that this is the ID of that card, right?
For this card, I get the following bytes from the reader (in hexadecimal representation): <42><09><01><74><00><74><5A><70>.
回答1:
The decimal number 0007625328 translates to 0x00745A70
in hexadecimal representation.
The number 116,23152 is actually a different representation of that same value (0007625328):
- 116 in decimal is
0x74
in hexadecimal. - 23152 in decimal is
0x5A70
in hexadecimal. - Combined, this also gives
0x00745A70
.
So the value that you receive (42 09 01 74 00 74 5A 70
) seems to be the concatenation of some form of prefix value (0x42090174
) and the printed card serial number (0x00745A70
).
来源:https://stackoverflow.com/questions/29798566/rfid-algorithm-to-get-card-id