Base 32 to binary converter

I have some magstripe cards that have a 9 digit(base 10) number reduced to 7 digits in base 32 to save space. (Go figure)

I need to output this in binary for use in an access control panel.

I am willing to build a small interface board. Any thoughts about any off the shelf technology before I start from scratch?

Thanks, Danno

Reply to
Danno
Loading thread data ...

How is the 9-digit decimal number 999999999 represented in the 7-digit base-32 format?

--
Tony Williams.
Reply to
Tony Williams

Since 999,999,999 fits in 32 bits (actually 30 bits), I presume that there is some advantage to using 7 5-bit groups (35 bits total) due to the physical nature of the card. What I don't understand is why they use 7 digits, when 6 was enough.

Reply to
Anthony Fremont

,

number

that

due to

they

There is likely an added check-sum for error detection.

Reply to
Clarence_A

--
Probably like this?

  9    9    9    9    9    9    9    9    9 
1001 1001 1001 1001 1001 1001 1001 1001 1001  Packed BCD

           29    25    21    18    15    31  
         11101 11001 10101 10010 01111 11111  Base 32
Reply to
John Fields

just think of Hex. for example. 15 DEc is F (4 bits). so base 16 ( 16 different combo's) in every 4 bits = 2^4 so now do that for a base 32.. that is 5 bits. 32 numbers total. etc..

Reply to
Jamie

Yes, those are the same numbers that I got John.

But the result is only 6 digits, and they are already a 30-bit binary representation of 999999999, and no further processing is required to get the OP what he apparently wanted (just Shifts and Adds in a uP).

I was trying to find out what I was missing.

Someone has already suggested that the 7th digit is a checksum. This makes sense, possibly something like a simple XOR of the other 6.

--
Tony Williams.
Reply to
Tony Williams

--
Since he represented them as "digits" I had thought they were clumped
in seven bit groups and perhaps he was asking about how to assemble
them into bytes(?) to input to his µC.  Maybe he'll post back with a
clarification...
Reply to
John Fields

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.