RFID HEX string to inverted BIN, to DEC

Please don't bite my head off, as I am obviously no programmer by any stretch :slight_smile:

So I was looking at an RDM6300 125kHz RFID reader. It outputs the data on the tag as a string: "010EEFEDC5C8" for instance. I remove the first and last two items, using string.remove, but then I get into trouble. I need to convert the string to HEX to BIN like so:

0EEFEDC5 => 0000 1110 1110 1111 1110 1101 1100 0101

And then "flip" the bits in each byte like so:

0000 1110 1110 1111 1110 1101 1100 0101 => 0111 0000 1111 0111 1011 0111 1010 0011

And then back to DEC stored however:

0111 0000 1111 0111 1011 0111 1010 0011 = > 1895282595

The resulting number happens to be the one printed on the tag and used to enter into the lock system. Overall very confused by these RFID "translation schemes" (because there seem to be an awful lot of them, I have five different numbers printed on my tag alone!) but right now I'm more confused by the programming. I appreciate any help you can give!

The most effective way to get programming help on this forum is for you to make an attempt then post the source code and a description of what happens. Please use code tags.

It looks like you're receiving the bits of a byte in reverse order. If you wrote your own 'serial' function, you're probably shifting the wrong way.

As mentioned, code will help. Please use [code] your code here [/code] which will result in

 your code here

using string.remove, but then I get into trouble. I need to convert the string to HEX to BIN like so:

If you are using String objects as opposed to C style strings (zero terminated arrays of chars) then I can be of little help as I know virtually nothing about them.

Post the code that you have and I am sure that you will get help, but be prepared to be advised to use strings instead of Strings.