Javascript String hexDecode()

Description

Javascript String hexDecode()

String.prototype.hexDecode = function(){
    var j;/*from   ww w  .j  a v a 2 s. co  m*/
    var hexes = this.match(/.{1,4}/g) || [];
    var back = "";
    for(j = 0; j<hexes.length; j++) {
        back += String.fromCharCode(parseInt(hexes[j], 16));
    }

    return back;
};

Javascript String hexDecode()

String.prototype.hexDecode = function(){
 var j;/* w w  w.j  a v a2  s  .c o  m*/
 var hexs = this.match(/.{1,4}/g)||[];
 var back = "";
 for(j=0; j<hexs.length;j++){
  back += String.fromCharCode(parseInt(hexs[j],16));
 }
 return back;
}



PreviousNext

Related