Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MD5 Hash
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00723039
Message ID:
00723531
Views:
8
>Thanks very much for the reply but I still don't understand how to transform a result like "B—ôK•R5$[$—9z“" which I get from MD5.FLL into a string like "42ca86fa7a6fbf3b05c82251a6af070e" which is what my client wants to see.
>
>Thanks Again...


You'll need to convert the byte string character-by-character using the ASC function, and then convert it to hex using TRANSFORM(). Your code would look something like:
FUNCTION ConvertToHex
LPARAMETER tcBinString
LOCAL cHexString, nCtr
cHexString = ''
FOR nCtr = 1 TO LEN(tcBinString)
   cHexString = cHexString + LOWER(PADL(TRANSFORM(ASC(SUBST(tcBinString,nCtr,1)),'@O'),2,'0'))
ENDFOR
RETURN cHexString
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform