convert md5digest to HEX?

kee nethery kee at kagi.com
Tue Nov 11 00:26:47 EST 2003


When I do
md5digest("billybob2003NOV11runCmd")
I get a string of text that is not email safe, it contains upper ascii 
characters that will get munged as it travels through the internet mail 
servers out there in the world.

I tried to use
baseConvert(md5digest("billybob2003NOV11runCmd"),???,16)
to convert it to hex but that keeps giving me an error because (I 
assume) I don't know what base to put into the originalbase parameter.


When I try
binaryDecode(???,md5digest("billybob2003NOV11runCmd"),???)
again I don't get an answer that looks correct because I don't 
understand what I am supposed to put into the formatsList nor the 
variablesList parameters.

If I loop through the characters of the md5digest, do a charToNum 
conversion and then convert base 10 num to base 16, (and pad the most 
significant digit if the result is less than hex "10"), I get the 
following result:
0B3B943EB414186491873361E5A2DF1D
Which looks exactly like what I want to see.

Is there a way to use baseConvert or binaryDecode to convert an 
md5digest result to hex?

Thanks,
Kee Nethery



More information about the use-livecode mailing list