smus 1 Posted January 22, 2019 Report 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? Quote Link to post Share on other sites
justsomeguy 1,135 Posted January 22, 2019 Report 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. Quote Link to post Share on other sites
smus 1 Posted January 26, 2019 Author Report 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 Quote Link to post Share on other sites
justsomeguy 1,135 Posted January 28, 2019 Report Share Posted January 28, 2019 It's pretty straight-forward, there should be plenty examples online. Quote Link to post Share on other sites
smus 1 Posted February 7, 2019 Author Report 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. Quote Link to post Share on other sites
justsomeguy 1,135 Posted February 7, 2019 Report 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. Quote Link to post Share on other sites
smus 1 Posted March 20, 2019 Author Report Share Posted March 20, 2019 Yeah, I agree. It's pretty straightforward Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.