code: function numberToHex(x, len = 0) {
    let str = x.toString(16);
    while (str.length < len) {
      str = `0${str}`;
    }
    return str;
  }
docs: /*
  convert a number to a hex string.
  @param {number} x - number to convert
  @param {number} len - minimum length of the string
  @returns {string} formatted hex string