ctype
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -807,5 +807,5 @@ /* | ||
wuint32(value[0], endian, buffer, offset); | ||
wuint32(value[1], endian, buffer, offset+3); | ||
wuint32(value[1], endian, buffer, offset+4); | ||
} else { | ||
wuint32(value[0], endian, buffer, offset+3); | ||
wuint32(value[0], endian, buffer, offset+4); | ||
wuint32(value[1], endian, buffer, offset); | ||
@@ -812,0 +812,0 @@ } |
@@ -196,3 +196,3 @@ /* | ||
* We're going to write 0s into the buffer if the string is shorter than the | ||
* length of the array. | ||
* length of the array. | ||
*/ | ||
@@ -199,0 +199,0 @@ function ctWriteCharArray(value, length, endian, buffer, offset) |
{ | ||
"name": "ctype", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "read and write binary structures and data types", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/rmustacc/node-ctype", |
@@ -118,4 +118,40 @@ /* | ||
function test64() | ||
{ | ||
var data = new Buffer(10); | ||
var value = 0x0007cda8e7f90a6d; | ||
var high = Math.floor(value / Math.pow(2, 32)); | ||
var low = value - (high * Math.pow(2, 32)); | ||
ASSERT.equal(0x0007cda8, high); | ||
ASSERT.equal(0xe7f90a6d, low); | ||
mod_ctype.wuint64([high, low], 'big', data, 0); | ||
ASSERT.equal(0x00, data[0]); | ||
ASSERT.equal(0x07, data[1]); | ||
ASSERT.equal(0xcd, data[2]); | ||
ASSERT.equal(0xa8, data[3]); | ||
ASSERT.equal(0xe7, data[4]); | ||
ASSERT.equal(0xf9, data[5]); | ||
ASSERT.equal(0x0a, data[6]); | ||
ASSERT.equal(0x6d, data[7]); | ||
mod_ctype.wuint64([high, low], 'little', data, 0); | ||
ASSERT.equal(0x6d, data[0]); | ||
ASSERT.equal(0x0a, data[1]); | ||
ASSERT.equal(0xf9, data[2]); | ||
ASSERT.equal(0xe7, data[3]); | ||
ASSERT.equal(0xa8, data[4]); | ||
ASSERT.equal(0xcd, data[5]); | ||
ASSERT.equal(0x07, data[6]); | ||
ASSERT.equal(0x00, data[7]); | ||
} | ||
test8(); | ||
test16(); | ||
test32(); | ||
test64(); | ||
exports.test8 = test8; | ||
exports.test16 = test16; | ||
exports.test32 = test32; | ||
exports.test64 = test64; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license
Found 1 instance in 1 package
153306
16
1
100
3819