code: function verifuint (value, max) {
    if (typeof value !== 'number') throw new Error('cannot write a non-number as a number')
    if (value < 0) throw new Error('specified a negative value for writing an unsigned value')
    if (value > max) throw new Error('RangeError: value out of range')
    if (Math.floor(value) !== value) throw new Error('value has a fractional component')
  }
docs: https://github.com/feross/buffer/blob/master/index.js#L1127