number formatting - Reading code from RFID card -
I have a problem reading the code from the RFID card.
Is there a conversion algorithm?
Examples of code: 04006d0ba0 - & gt; 00008596950352 0d001c59b3 - & gt; 00047253268956 0d001c5134 - & gt; 00047253268674 0d001c9317 - & gt; 00047253265550 0d001c93ed - & gt; 00047253265531 0d001c1b12 - & gt; 00047253261700 0d001c1b1d - & gt; 00047253261707 e800ef0aac - & gt; 00485339628883
The same RFID card, different output from different readers ...
I know that the subject is still present, but I think it is a Not the only problem ..
The conversion looks quite simple:
-
Let's assume Take that you want to change from "04006d0ba0" to "000085 9 6950352". "0", then "0", then "6", ...)
-
Hexadecimal number "04006d0ba0" (i.e. "0", then "4", each take a pigeon) / P>
-
Reverse bits of each moth (at least the critical bit becomes the most important bit, the second bit becomes the second last bit), such as "0" (=
<0000
) remains "0" (=0000
), "4" (=0100
) "2" (=0010
), "6" (=0110
) remains "6" (=0110
), etc. -
Change in decimal number format.
In Java, this may look something like this:
Private Static Final byte [] REVERSE_NIBBLE = {0x00, 0x08, 0x04, 0x0C, 0x02, 0x0a, 0x06, 0x0E, 0x01, 0x0 9, 0x05, 0x0D, 0x03, 0x0B, 0x07, 0x0F}; Private Long Convert (Byte [] Input) {Byte [] Output = New Byte [input.length]; For (int i = 0; i & lt; input.length; ++ i) {output [i] = (byte) ((reverse ANBBE [(output [i] >> gt; 4) & amp; 0x0F] & Lt; & lt; 4) | REVERSE_NIBBLE [Output [i] & amp; 0x0F]); } Return the new BigTiger (1, output) LongValue (); }
Comments
Post a Comment