code: function hextoArrayBuffer(hex) {
      if (hex.length % 2 != 0) throw "input is not even length";
      if (hex.match(/^[0-9A-Fa-f]+$/) == null) throw "input is not hexadecimal";
  
      var buffer = new ArrayBuffer(hex.length / 2);
      var view = new DataView(buffer);
  
      for (var i = 0; i < hex.length / 2; i++) {
  	view.setUint8(i, parseInt(hex.substr(i * 2, 2), 16));
      }
  
      return buffer;
  }
docs: ==== hex / ArrayBuffer ================================= 
  convert a hexadecimal string to an ArrayBuffer<br/>
  @name hextoArrayBuffer
  @function
  @param {String} hex hexadecimal string
  @return {ArrayBuffer} ArrayBuffer
  @since jsrsasign 6.1.4 base64x 1.1.8
  @description
  This function converts from a hexadecimal string to an ArrayBuffer.
  @example
  hextoArrayBuffer("fffa01") &rarr; ArrayBuffer of [255, 250, 1]