分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow
也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!
转自:http://blog.csdn.net/kandyer/article/details/8241894
//十六进制字符串转字节数组function Str2Bytes(str){ var pos = 0; var len = str.length; if(len %2 != 0) { return null; } len /= 2; var hexA = new Array(); for(var i=0; i<len; i++) { var s = str.substr(pos, 2); var v = parseInt(s, 16); hexA.push(v); pos += 2; } return hexA;} //字节数组转十六进制字符串function Bytes2Str(arr){ var str = ""; for(var i=0; i<arr.length; i++) { var tmp = arr[i].toString(16); if(tmp.length == 1) { tmp = "0" + tmp; } str += tmp; } return str;}