smus Posted January 22, 2019 Share Posted January 22, 2019 Couldn't find the information how on how to convert the hex values into ascii ('31' > '1', '32' > '2' etc.). Could anyone remind me which method/function I should use? Link to comment Share on other sites More sharing options...
justsomeguy Posted January 22, 2019 Share Posted January 22, 2019 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 More sharing options...
smus Posted January 26, 2019 Author Share Posted January 26, 2019 (edited) 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)) //31 but have no idea about the backward conversion. Edited January 26, 2019 by smus Link to comment Share on other sites More sharing options...
justsomeguy Posted January 28, 2019 Share Posted January 28, 2019 It's pretty straight-forward, there should be plenty examples online. Link to comment Share on other sites More sharing options...
smus Posted February 7, 2019 Author Share Posted February 7, 2019 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 More sharing options...
justsomeguy Posted February 7, 2019 Share Posted February 7, 2019 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 More sharing options...
smus Posted March 20, 2019 Author Share Posted March 20, 2019 Yeah, I agree. It's pretty straightforward Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now