Closed vekexasia closed 6 months ago
Apparently the library can't handle negative values (both encoding and decoding)
console.log(toBufferLE(-1n, 1)); console.log(toBufferLE(1n, 1));
outputs <Buffer 01> <Buffer 01>
but it should really not be the case.
for those of you landing in this issue cause you need a bigint <-> buffer implementation that is sign-sensitive, i've created a library just for that:
Apparently the library can't handle negative values (both encoding and decoding)
console.log(toBufferLE(-1n, 1)); console.log(toBufferLE(1n, 1));
outputs <Buffer 01> <Buffer 01>
but it should really not be the case.