<%
Public Function bu_Str2Hex(str)
' Converts string <str> of chars to string in hex byte format
' E.g. "abc" will be converted to "616263"
sHex = ""
n = Len(str)
For i = 1 To n
byt = CByte(Asc(Mid(str, i, 1)))
If Len(Hex(byt)) = 1 Then
sHex = sHex & "0" & Hex(byt)
Else
sHex = sHex & Hex(byt)
End If
Next
bu_Str2Hex = sHex
End Function
Str = "abc"
strHex = bu_Str2Hex(str)
%>
<html>
str: [<%= Str %>]<br>
hex: [<%= strHex %>]
</html>
Public Function bu_Str2Hex(str)
' Converts string <str> of chars to string in hex byte format
' E.g. "abc" will be converted to "616263"
sHex = ""
n = Len(str)
For i = 1 To n
byt = CByte(Asc(Mid(str, i, 1)))
If Len(Hex(byt)) = 1 Then
sHex = sHex & "0" & Hex(byt)
Else
sHex = sHex & Hex(byt)
End If
Next
bu_Str2Hex = sHex
End Function
Str = "abc"
strHex = bu_Str2Hex(str)
%>
<html>
str: [<%= Str %>]<br>
hex: [<%= strHex %>]
</html>