Sunday, August 10, 2008

AHK - ASCII to HEX converter

This is a simple function that converts ASCII into HEX
AscToHex(str)
{
NStr =
Tmp := A_FormatInteger
SetFormat, Integer, H
Loop, Parse, str
NStr .= RegExReplace(asc(A_LoopField),"^0x")
SetFormat, Integer, %Tmp%
Return NStr
}
For example, "Hello World!" becomes
48656C6C6F20576F726C6421

No comments: