This repository has been archived by the owner on Apr 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds js implementation of rabin chunker for windows and browser (…
…#30)
- Loading branch information
1 parent
c849359
commit 542b3e4
Showing
6 changed files
with
232 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
I think this is a bug left over from a prior iteration of the code, but it’s still present in the latest version of this module.
pending
is being cleared on every iteration. in the newest code it’s even copied into a new single buffer usingBuffer.concat()
. This is all unnecessary because you’re only ever processing one chunk.However, based on this code I’m going to guess that
getFingerprints
doesn’t guarantee it will return slices through the end of the bytes it is given. If that’s true, then there’s a bigger bug in this code, which is that you should be processing a concatenated version of thebuffers
object usingbuffers.slice()
since the rest of the code seems to be keeping the tail of any remaining data intact.Either
getFingerprints
always gives you slices through the end of the file or this code is dropping small amounts of data from the tail of each chunk and then slicing the wrong data out ofbuffers
.