Re: converting hex strings to decimal digits strings

New Message Reply About this list Date view Thread view Subject view Author view

Adam Back (aba@dcs.ex.ac.uk)
Wed, 25 Mar 1998 11:12:18 GMT


10^9 fits inside a 32 bit word, so Eric and Martin Diehl are
discussing dividing by 10^9 repeatedly.

Would it not be quicker to divide by w, w = 10^9, n is the a (for
example) 1024 bit number

a0 = n / w^32; a1 = n mod w^32

b0 = a0 / w^16; b1 = a0 mod w^16; b2 = a1 / w^16; b3 = a1 mod w^16;

c0 = b0 / w^8; c1 = b0 mod w^8; c2 = b1 / w^8; c3 = b1 mod w^8;
c4 = b2 / w^8; c5 = b2 mod w^8; c6 = b3 / w^8; c7 = b3 mod w^8;

....

until you reach f and are dividing by w (10^9), then you print out:

f0 .. f63

(omitting the leading zero f{i} elements), and with some optimisation
to avoid computation dividing parts which are zero?

Adam

-- 
Now officially an EAR violation...
Have *you* exported RSA today? --> http://www.dcs.ex.ac.uk/~aba/rsa/

print pack"C*",split/\D+/,`echo "16iII*o\U@{$/=$z;[(pop,pop,unpack"H*",<> )]}\EsMsKsN0[lN*1lK[d2%Sa2/d0<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<J]dsJxp"|dc`


New Message Reply About this list Date view Thread view Subject view Author view

 
All trademarks and copyrights are the property of their respective owners.

Other Directory Sites: SeekWonder | Directory Owners Forum

The following archive was created by hippie-mail 7.98617-22 on Fri Aug 21 1998 - 17:16:14 ADT