I couldn't find any hex encoding or decoding functions on the web so I was forced to write my own. There was one website that had these functions but you had to enter your email address to get the code, because of this I'm posting these here. The encode function precedes each hex ascii value with a percent sign, so they can be used in URL's, so it's useful for obfuscating URL's. The decode function expects a string encoded in the same format.
function hexEncode(str)
dim strEncoded, i
strEncoded = ""
for i = 1 to Len(str)
strEncoded = strEncoded + "%" + Hex(Asc(Mid(str, i, 1)))
next
hexEncode = strEncoded
end function
function hexDecode(str)
dim strDecoded, i, hexValue
strDecoded = ""
for i = 2 to Len(str)
hexValue = ""
while Mid(str, i, 1) <> "%" and i <= Len(str)
hexValue = hexValue + Mid(str, i, 1)
i = i+1
wend
strDecoded = strDecoded + chr(CLng("&h" & hexValue))
next
hexDecode = strDecoded
end function