Here you can find the source of hexTOstr()
String.prototype.hexTOstr = function() { var o = "", l = this.length; for (var x = 0; x < l; x += 2) {/*from w w w.j ava 2s . c om*/ o += String.fromCharCode(parseInt(this.substr(x, 2), 16)); } return o; }