~ The Largest Muslim Hacker Community ~
 
HomeCalendarFAQSearchMemberlistUsergroupsRegisterLog in
LINK PARTNER










Top posters
Rascal_21
 
Moeslim_Soldiers
 
Cvh0
 
h1t4k3
 
offistar
 
menjelajahbumi
 
riv182
 
0nCeR
 
ohara_inamiji
 
Kn19ht
 

Share | 
 

 Script ASCII TO HEX

Go down 
AuthorMessage
Rascal_21

avatar

Posts : 196
Join date : 2010-09-30
Age : 27
Location : Al bantani

PostSubject: Script ASCII TO HEX   Wed Oct 13, 2010 12:51 am

Script ASCII TO HEX

Code:
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
 <title>ASCII TO HEX</title>
<script language="javascript" type="text/javascript">
<!--

function decode(){
  if(document.forms[0].hex.value != ''){
        var vText = document.forms[0].hex.value;
        document.forms[0].ascii.value = unescape(vText);
  }
}

function encode(){
  if(document.forms[0].ascii.value != ''){
    var vText = document.forms[0].ascii.value;
    document.forms[0].hex.value = convertToHex(vText);
        var vEncoded = convertToUnicode(vText);
    document.forms[0].unicode.value = vEncoded;
        document.getElementById("unicodeHTML").innerHTML = vEncoded;
    document.forms[0].ascii.focus();
   document.forms[0].ascii.blur();
   document.forms[0].ascii.select();
  }
}



function convertToUnicode(source) {
  result = '';
  for (i=0; i<source.length; i++)
    result += '&#' + source.charCodeAt(i) + ';';
  return result;
}

             
function convertToHex(num) {
  var hex = '';
  for (i=0;i<num.length;i++)
    hex += "%" + num.charCodeAt(i).toString(16).toUpperCase();
  return hex;
}



/* ************************************************* */

function convertToASCII() {
   if (document.forms[0].unicode.value != '') {
      var uniText = document.forms[0].unicode.value;
      var testText = uniText.substring(2,uniText.length-1).split(";&#")
      var resultString = ""
      for (i=0;i<testText.length;i++)
         resultString += "%" + dec2hex(testText[i])
      document.forms[0].ascii.value = unescape(resultString);
   }
}

function dec2hex(n){
var hex = "0123456789ABCDEF";
var mask = 0xf;
var retstr = "";
   while(n != 0){
      retstr = hex.charAt(n&mask) + retstr;
      n>>>=4;
   }

 return retstr.length == 0 ? "0" : retstr;
}

/* ************************************************* */



//-->
</script>



 </head><body bgcolor="black" text="lime">
<h1 align="center">Al-Bantani Crew a.k.a Pandeglang Hakcer Team</h1>

<center>
<form name="blah" action="">
<br>

<b>ASCII Text:</b><br>
<input name="ascii" size="60" type="text">&nbsp;
<br><input value="Encode" onclick="encode()" type="button"><br>

<b>Hex Value:</b><br>
<input name="hex" size="60" type="text">&nbsp;
<br><input value="Decode Hex to ASCII" onclick="decode()" type="button"><br>
<b>Unicode Value:</b><br>
<input name="unicode" size="60" type="text">
&nbsp;
<br><input value="Decode Unicode to ASCII" onclick="convertToASCII()"
type="button"><br>
<br>
<span id="unicodeHTML"></span>
<input value="HAPUS"
onclick="document.getElementById('unicodeHTML').innerHTML = ''"
type="reset">

</form>

</center>

</body></html>

Untuk test
Copy code diatas..... save dgn Extensi .htm atau .html

Mga bermanfaat...^_*
Back to top Go down
View user profile http://rascal-21.cz.cc/
 
Script ASCII TO HEX
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
[+] Al Bantani Crew a.k.a Pandeglang Hacker Team [+] :: Html - Css - Javascript - Php & MySQL-
Jump to: