www.a00.de > tcpgroup > 1994 > msg00027
 

TCP-group 1994


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

smashing down callsigns into 32 bits



>Steven R. Sampson wrote:
>>ZZ9ZZZ is then:
>>
>>	Z	26 * 10 ^ 6	26000000
>>	Z	26 * 10 ^ 5	 2600000
>>	9	 9 * 10 ^ 4	   90000
>>	Z	26 * 10 ^ 3	   26000
>>	Z	26 * 10 ^ 2	    2600
>>	Z	26 * 10 ^ 1	     260
>>	--------------------------------
>>	Total			28718860	Fits in 32 bits
>>	Hex		     01 B6 37 0C
>>	HAM IP Address	     1.182.55.12
>>	Gateway IP Address   44.00.00.78	For example.


>Neill G4HLX replied:
>Nice idea, but it doesn't give unique addresses, I'm afraid.  Try, for 
>example, encoding these two callsigns in this scheme:
>
>    ZZ9ZBA   ZZ9ZAK
>
>You will find they both give 1.185.156.249.

It turns out to be easy to map 6-character identifiers (including callsigns)
into 32 bits uniquely.

Those of us who are "old timers" can remember a DEC funny format called
"Radix 40".  It coded 3 characters into 16 bits. (You see, 40^3 = 64,000)

The character set had, as you might suspect, 40 charcters:  0-9, A-Z, space
and 3 punctuation marks.  Have you ever wondered why on those old DEC minis
you had filenames like FOOBAR.BAZ?  Now you know: filenames fit into 3
16-bit words!

I don't remember the exact Radix 40 format (maybe some other gray-hair can
dig it up?), so assume this mapping:

Char	Value
----	-----
0-9	0-9
space	10
A-Z	11-36
-	37
!	38
$	39	(Picking 3 arbitrary punctunation chars to round out the list).

Then, using G4HLX's examples, ZZ9ZBA is:

ZZ9 first. 'Z'=36, '9'=9 therefore the first piece is 36 + 36*40 + 9*40^2
which is 15,876.

ZBA = 36 + 12*40 + 11*40^2 = 18,116   and ZAK = 36 + 11*40 + 21*40^2 = 34,076


To decode, for example, 18,116 you do this:

18,116 / 40 = 452 remainder of 36 -> 'Z'

   452 / 40 =  11 remainder of 12 -> 'B'
                |
                +------------------> 'A'



So, it can be done with little computation.  How does this help?


-Mike K3MC = 36,941 16,413 = 90 4d 40 1d = "144.77.64.29" 




Document URL : http://www.a00.de/tcpgroup/1994/msg00027.php
Ralf D. Kloth, Ludwigsburg, DE (QRQ.software). < hostmaster at a00.de > [don't send spam]
Created 2004-10-04. Last modified 2004-10-04. Your visit 2020-10-27 22:53.38. Page created in 0.0498 sec.
 
[Go to the top of this page]   [... to the index page]