Small hex string encode & decode Class written for Classic ASP
Include the /hexa.class.asp class at the beginning of your Classic ASP page:
<!-- #include virtual="/hexa.class.asp" -->
The Hexa class will be created with the following functions:
Hexa.Encode(t)
Encode the contents of the 't' string.
Hexa.Decode(t)
Decode the contents of the 't' string from hex to ASCII.
Hexa.Write(t)
Same as Hexa.Encode but also includes "HEX:" at beginning of output to identify string as being hex.
Hexa.Read(t)
Same as Hexa.Decode but will check for "HEX:" to verfy that string is hex, and only decode if necessary.
Hexa.Encoded
and Hexa.Decoded
are two additional public variables that store the previously encoded and decoded strings.
Hexa.Reset
Use this command to clear the above strings.
Hexa.Truncate(text,size)
Additional function used to truncate string text to a maximum size. If string length is greater than size then text will be truncated (clipped), with a "... [TRUNCATED]" message appended to the end of the string.
set Hexa = nothing
Close and free-up memory after using (only needed once, at the end of your code.)