function hex2buffer(hex) {
  // use buffer built-in function to convert from hex-string to buffer
  const buff = hex != null && Buffer.from(hex, 'hex');
  return buff;
}
Helper function to convert the input hex-string to a buffer
@param {String} hex The hex string to convert
@returns {Buffer} The hex as buffer
@api private