Converting negative numbers to Buffers #24

yefremov opened this Issue Apr 26, 2013 · 0 comments


None yet

1 participant


This is more a question: is there any plans when conversion of ngeative numbers to buffers will be implemented?

As of now I'm doing this to convert negative numbers to Int64:

var buf1 = new Buffer(4);
var buf2 = new Buffer(4);

buf1.writeInt32BE(-1, 0);
buf2.writeInt32BE(-1, 0);

// <Buffer ff ff ff ff ff ff ff ff>
var buf3 = Buffer.concat([ buf1, buf2 ]); 

It would be very handy to utilize only bigint package to achieve the same result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment