Here you can find the source of hex2bin()
String.prototype.hex2bin = function () { var i = 0, l = this.length - 1, bytes = [] for (i; i < l; i += 2) {/*from w w w .j a v a 2 s. com*/ bytes.push(parseInt(this.substr(i, 2), 16)) } return String.fromCharCode.apply(String, bytes) }
String.prototype.hex2bin = function () { var i = 0, l = this.length - 1, bytes = [] for (i; i < l; i += 2) bytes.push(parseInt(this.substr(i, 2), 16)) return String.fromCharCode.apply(String, bytes)