Comparing version 2.5.1 to 2.5.2
@@ -48,3 +48,3 @@ // Copyright (c) 2015 Uber Technologies, Inc. | ||
} else if (typeof value === 'number') { | ||
buffer.writeInt32BE(value / Math.pow(32), offset, true); | ||
buffer.writeInt32BE(value / Math.pow(2, 32), offset, true); | ||
buffer.writeInt32BE(value, offset + 4, true); | ||
@@ -51,0 +51,0 @@ return new bufrw.WriteResult(null, offset + 8); |
{ | ||
"name": "thriftrw", | ||
"version": "2.5.1", | ||
"version": "2.5.2", | ||
"description": "thrift encoding/decoding using bufrw", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
@@ -140,3 +140,3 @@ // Copyright (c) 2015 Uber Technologies, Inc. | ||
test('coerce number', function t(assert) { | ||
test('coerce small number', function t(assert) { | ||
var buffer = new Buffer(8); | ||
@@ -150,2 +150,11 @@ var res = bufferRW.writeInto(10, buffer, 0); | ||
test('coerce large number', function t(assert) { | ||
var buffer = new Buffer(8); | ||
var res = bufferRW.writeInto(Math.pow(2, 50), buffer, 0); | ||
assert.ifError(res.err, 'write into buffer'); | ||
assert.equals(res.offset, 8, 'offset after write'); | ||
assert.deepEquals(buffer, new Buffer('0004000000000000', 'hex'), 'written value'); | ||
assert.end(); | ||
}); | ||
test('coerce array of bytes', function t(assert) { | ||
@@ -152,0 +161,0 @@ var buffer = new Buffer(8); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
372347
6617