Closed tonistiigi closed 11 years ago
Hi and thanks for you work!
Is the overflow present in node's original module? Even though it is a bug, I want to stick to node's implementation as much as possible so that there's no surprise when running code on browserify that has been written for node..
Yes, this is the way node handles overflow. I also added a testcase that compares results from node to this module.
The implementation is different because in node its based on fixed length typed-array and there is no way to write over the length of the buffer. In buffer-browserify
it just directly accesses slowbuffer and length has no special meaning.
Oh, my bad I did not see the test. Merging, thanks!
buffer-browserify does not handle writing and reading out of bounds correctly.
This PR only fixes Integers. Floats probably have same issues.