-1
\$\begingroup\$

I am creating application which needs to read RFID tag.

In this application RFID UID is saved in comma separated type(ex. 23,192,251,159,179).

But I have a reader which is getting that information in 10-digit type(ex. for same RFID tag is 2684076055).

I need to get formula to convert it from type to another.

Does anybody know how to convert it?

\$\endgroup\$
  • 1
    \$\begingroup\$ you could use a byte counter to insert a comma after a certain count is reached, i.e. first 2, and then 3 numbers each \$\endgroup\$ – QuickishFM Jul 2 at 17:40
  • \$\begingroup\$ Do you think that there is formula to convert "2684076055" to "23,192,251,159,179" ? I would need that because my RFID reader is only giving me this number "2684076055". \$\endgroup\$ – Jakov Kusić Jul 2 at 17:44
3
\$\begingroup\$
  1. Convert the RFID (2684076055) to hexadecimal: 9FFBC017
  2. Convert the bytes (9F FB C0 17) to decimal: 159 251 192 23
  3. Reverse the list and add commas: 23, 192, 251, 159

Your integer seems to be missing a few digits. The 179 isn't there - one byte worth of RFID is missing.


Alternatively, you could use bit operations to isolate specific bytes (AND with specific values) and right shifting to move each byte down tothe lowest eight bits of the integer and assemble your RFUID from that.


This is programming and math, and has little that is specific to electrical engineering.

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

First part of answer by JRE is correct, but it is possible to get 179 by using XOR.

179 = 159 XOR 251 XOR 192 XOR 23
| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ Ah. The 179 is a checksum, then. \$\endgroup\$ – JRE Jul 3 at 12:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.