How to convert String to Hex
Posted on January 4, 2009
1 2 3 4 5 6 7 8 9 10 11 12 13 | 'String Manipulation - How to convert String to Hex 'Converts Stings to Hex (Useful for Encryption/Registry) Option Explicit Public Function StringToHex(ByVal strData As String) As String Dim sResult As String Do Until Len(strData) = 0 sResult = sResult & Right$(String$(2, "0") & Hex$(Asc(Left$(strData, 1))), 2) strData = Right$(strData, Len(strData) - 1) Loop StringToHex = sResult End Function |