Monday, 27 February 2012

Javascript Hex Decode and Encode



One day this script would be handy, very handy indeed :)
anyway,, If you can't say something good say nothing at all. :D
but When you think something good… SAY IT.




String.prototype.hexEncode=function(){
var r='';
var i=0;
var h;
while(i h=this.charCodeAt(i++).toString(16);
while(h.length<2){
h=h;
}
r+=h;
}
return r;
};

No comments:

Post a Comment