Simplify calculating hash from file with chunked-file-reader #49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The chunked-file-reader comes with the functionality of reading a file in chunks, so we can simplify the file example a lot by offloading this logic to that package. I think this will make it much more approachable for people wanting to reuse that code.
The chunked-file-reader package uses
readAsArrayBuffer()
, and we cannot use it for tests that usereadAsBinaryString()
.Also, chunked-file-reader always uses
File.prototype.slice
, but I think that's ok now, sinceblob.mozSlice()
is only needed for Firefox 12 and earlier, though I don't on which version did Safari start supportingFile.prototype.slice
(I tested that it works on Safari 11 which is the current latest version).Closes #48