code: function hexStr2byteArray(str) {
    var byteArray = Array();
    var d = 0;
    var j = 0;
    var k = 0;
  
    for (let i = 0; i < str.length; i++) {
      var c = str.charAt(i);
      if (isHexChar(c)) {
        d <<= 4;
        d += hexChar2byte(c);
        j++;
        if (0 === (j % 2)) {
          byteArray[k++] = d;
          d = 0;
        }
      }
    }
    return byteArray;
  }
docs: /* Convert HEX string to byte array 16进制的ASCII字符串转为byteArray格式。