ipfs-inactive / js-ipfs-unixfs-importer

[ARCHIVED] JavaScript implementation of the UnixFs importer used by IPFS
MIT License
5 stars 4 forks source link

fix: slice tail data, fixes #40 #36

Closed mikeal closed 5 years ago

mikeal commented 5 years ago

I had to modify one of the tests because I think it was actually wrong about how rabin should chunk up the data it was testing.

4 browser tests are failing on my machine, but they were already failing with the current checkout so hopefully CI can show me if this is just a local issue or not.

mikeal commented 5 years ago

Also, I modified how and when the loop calls bl.consume() so that it only does it once per fingerprint. This should cut out a bunch of unnecessary memcopies.

mikeal commented 5 years ago

Now that I think about it, an even more efficient approach would be to do buffers = buffers.shallowSlice(start) so that it doesn’t do a memcopy at all.

I can send that as another PR or add it to this one. Let me know what you’d prefer.

mikeal commented 5 years ago

Closing.

There’s a bug but I was wrong about the nature of the bug, I’ll send a new PR.