CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript programming (http://www.codingforums.com/forumdisplay.php?f=2)
-   -   need help translating (http://www.codingforums.com/showthread.php?t=285018)

vegetto4093 12-30-2012 02:43 AM

need help translating
 
i know nothing about java script, but i need to translate this so another program can understand it.

here's the code:

function jal(str){var zwq = '';for(var i=0;i < str.length;i++){zwq += ''+str.charCodeAt(i).toString(16);}return zwq;}

where the str = "http://atdhenet.tv/"

there's another var that is assigned like this

var kol = jal("http://atdhenet.tv/")

so i just need to know what var kol will end up being :/

thanks for all your help

Old Pedant 12-30-2012 06:54 AM

You could have found out by simply creating an HTML page with *ONLY* this content:
Code:

<script>
function jal(str){var zwq = '';for(var i=0;i < str.length;i++){zwq += ''+str.charCodeAt(i).toString(16);}return zwq;}

var kol = jal("http://atdhenet.tv/");

document.write(kol);
</script>

and then showing that HTML page in your browser.

You would have seen:
Code:

687474703a2f2f61746468656e65742e74762f
But you could also have translate it by hand by simply looking up the hexadecimal value of each character in the string.

That is, "h" has hex value "68", "t" has value "74", etc.


All times are GMT +1. The time now is 12:05 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.