code: function bufferFromHexStr(hexStr) {
    // Remove whitespace.
    hexStr = hexStr.replace(/\s+/g, '');
  
    // Remove 0x.
    hexStr = no0x(hexStr);
  
    // Hex values with an odd number of characters need to be padded; otherwise the last character will be truncated.
    if (hexStr.length % 2) hexStr = '0' + hexStr;
  
    // Convert to a buffer.
    return Buffer.from(hexStr, 'hex');
  }
docs: /* Obtain a buffer from a hex value in string representation.
  * Whitespace is removed prior to conversion.
  *
  * @param {string} hexStr - A hex value in string representation.
  * @return {buffer} The hex value as a byte array.