Base 32 to binary converter

D

Danno

Guest
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
 
In article <1105577741.188194.178610@z14g2000cwz.googlegroups.com>,
Danno <service@americansafe.biz> wrote:
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)
How is the 9-digit decimal number 999999999 represented
in the 7-digit base-32 format?

--
Tony Williams.
 
"Tony Williams" <tonyw@ledelec.demon.co.uk> wrote in message
news:4d2d104a11tonyw@ledelec.demon.co.uk...
In article <1105577741.188194.178610@z14g2000cwz.googlegroups.com>,
Danno <service@americansafe.biz> wrote:
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)

How is the 9-digit decimal number 999999999 represented
in the 7-digit base-32 format?
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.
 
Tony Williams wrote:

In article <1105577741.188194.178610@z14g2000cwz.googlegroups.com>,
Danno <service@americansafe.biz> wrote:

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)


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

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..
 
In article <qv7gu0t3mpl1vqr0ub0359pmrnfjmcdaus@4ax.com>,
John Fields <jfields@austininstruments.com> wrote:

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

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
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.
 
On Fri, 14 Jan 2005 09:54:00 +0000 (GMT), Tony Williams
<tonyw@ledelec.demon.co.uk> wrote:

In article <1105577741.188194.178610@z14g2000cwz.googlegroups.com>,
Danno <service@americansafe.biz> wrote:
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)

How is the 9-digit decimal number 999999999 represented
in the 7-digit base-32 format?
---
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


--
John Fields
 
"Anthony Fremont" <spam@anywhere.com> wrote in message
news:heOFd.3285$Ta2.2303@fe2.texas.rr.com...
"Tony Williams" <tonyw@ledelec.demon.co.uk> wrote in message
news:4d2d104a11tonyw@ledelec.demon.co.uk...
In article
1105577741.188194.178610@z14g2000cwz.googlegroups.com>,
Danno <service@americansafe.biz> wrote:
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)

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

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.
There is likely an added check-sum for error detection.
 
On Sat, 15 Jan 2005 00:00:13 +0000 (GMT), Tony Williams
<tonyw@ledelec.demon.co.uk> wrote:

In article <qv7gu0t3mpl1vqr0ub0359pmrnfjmcdaus@4ax.com>,
John Fields <jfields@austininstruments.com> wrote:

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


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

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).
---
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...
---

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.
---
Could be.

--
John Fields
 

Welcome to EDABoard.com

Sponsor

Back
Top