Go Down

### Topic: 125Khz ID number conversion (Read 620 times)previous topic - next topic

#### camilo-nunez

##### Feb 08, 2015, 06:46 pm
Hi guys !

I need your help to understand how to perform the conversion of the ID number that leaves both the token as 125khz cards (such as photos) to hexagecimal.

From what I have understood, the IDs are in decimal numbers and what I want is to perform the conversion to HEX. In my case, I'm using an ID-20 reader connected to an Arduino, but the digits that attached me are not what goes find in a normal conversion DEC to HEX.

In the case of token photo, the conversion according in the Arduino is 004F0CA and the card is 550933FC2 (5 byte code). But in a conversion from decimal to hexadecimal in http://www.binaryhexconverter.com/decimal-to-hex-converter , for the token is 4F01CA and the card is 933FC2. The difference in the first numbers regarding the Arduino is what I question.

My idea is to create a simple scritp in python where enter the decimal ID and I return the code in hexagecimal as the arduino.

You know how to do this convertion? What role do the first zeros in the ID? is possible make a script in python for this project?

Thank you very much for your help!

#### Grumpy_Mike

#1
##### Feb 08, 2015, 07:21 pm
Quote
From what I have understood, the IDs are in decimal numbers
No it is all in binary. Hex or decimal are simply conversions that make it easy for us to see.

Quote
hexagecimal

Quote
is possible make a script in python for this project?
Yes.

Quote
What role do the first zeros in the ID?
They are just that, they are zeros in the bit pattern that is the number.

The number in the photo 5177802 in hex is 4F01CA which is very close to what you say the Arduino gives which is 4F0CA.
So it is important to actually return the number printed on the card? Will not just a unique number suite your application?

Go Up