I'm hoping this is user error but I am not getting expected results trying to pack a signed long (8 byte integer), my test case value is 579
. From the documentation, I assume 'q' is the correct format, and I'm working in Big Endian. My "other" program gives me [0, 0, 0, 0, 0, 0, 2, 67]
. using 'i', 'I', 'l' and 'L' I get [0, 0, 2, 67]
as expected, however using the 8 byte formats I just get zeros...
console.log("pack >i 579", jspack.Pack(">i", [579]));
console.log("pack >I 579", jspack.Pack(">I", [579]));
console.log("pack >l 579", jspack.Pack(">l", [579]));
console.log("pack >L 579", jspack.Pack(">L", [579]));
console.log("pack >q 579", jspack.Pack(">q", [579]));
console.log("pack <q 579", jspack.Pack("<q", [579]));
console.log("pack >Q 579", jspack.Pack(">Q", [579]));
console.log("pack >f 579", jspack.Pack(">f", [579]));
console.log("pack >d 579", jspack.Pack(">d", [579]));
output:
pack >i 579 (4) [0, 0, 2, 67]
pack >I 579 (4) [0, 0, 2, 67]
pack >l 579 (4) [0, 0, 2, 67]
pack >L 579 (4) [0, 0, 2, 67]
pack >q 579 (8) [0, 0, 0, 0, 0, 0, 0, 0]
pack <q 579 (8) [0, 0, 0, 0, 0, 0, 0, 0]
pack >Q 579 (8) [0, 0, 0, 0, 0, 0, 0, 0]
pack >f 579 (4) [68, 16, 192, 0]
pack >d 579 (8) [64, 130, 24, 0, 0, 0, 0, 0]
is this a bug or am i doing it wrong?