Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
value = +value
- offset = offset >>> 0
+ offset = offset | 0
if (!noAssert) {
- checkInt(
- this, value, offset, byteLength,
- Math.pow(2, 8 * byteLength - 1) - 1,
- -Math.pow(2, 8 * byteLength - 1)
- )
+ var limit = Math.pow(2, 8 * byteLength - 1)
+
+ checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
var i = 0
Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
value = +value
- offset = offset >>> 0
+ offset = offset | 0
if (!noAssert) {
- checkInt(
- this, value, offset, byteLength,
- Math.pow(2, 8 * byteLength - 1) - 1,
- -Math.pow(2, 8 * byteLength - 1)
- )
+ var limit = Math.pow(2, 8 * byteLength - 1)
+
+ checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
var i = byteLength - 1