The expression new Buffer(1).writeUIntBE(0x100,0,1) should throw an out-of-bounds error, but it does not. In the source code, value validation is coded as follows: checkInt(this, value, offset, byteLength, Math.pow(2, 8 \* byteLength), 0); Here, max value should be Math.pow(2, 8 \* byteLength) - 1 ?