Jump to content

Hex to ASCII


Recommended Posts

I'm assuming you're talking about VBScript and not Javascript.  If you're talking about getting an ASCII character from an 8-bit number, you use Chr for that.  I don't see a function to convert a hex number to int (I don't think VBScript recognizes hex numbers at all), so you would probably have to just write a function to take a string of hex digits and convert to integer.

Link to comment
Share on other sites

Yes, exactly, VBScript. I've found the way to perform the opposite action (ascii into hex):

dim x

x = 1

response.write hex(asc(x))


but have no idea about the backward conversion.

Edited by smus
Link to comment
Share on other sites

  • 2 weeks later...
On ‎1‎/‎28‎/‎2019 at 11:53 PM, justsomeguy said:

It's pretty straight-forward, there should be plenty examples online.

It is, but to be honest, I couldn't find the solution. Unfortunately, classic ASP is not really popular nowadays.

Link to comment
Share on other sites

If you're looking for something you can copy and paste, yeah, you might not find that.  If you search for how to convert hex to base-10 in general then you'll find plenty of examples that hopefully you can figure out how to write in whatever language you're using.  Converting between number bases is very common and part of a first-year computer science education, you'll find plenty of examples.

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...