Javascript String hexEncode8()
String.prototype.hexEncode8 = function(){ var hex, i;//from www. j a v a2 s.c om var result = ""; for (i=0; i<this.length; i++) { hex = this.charCodeAt(i).toString(16); result += ("0"+hex).slice(-2); } return result }