Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify calculating hash from file with chunked-file-reader #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

janko
Copy link

@janko janko commented Apr 27, 2018

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 use readAsBinaryString().

Also, chunked-file-reader always uses File.prototype.slice, but I think that's ok now, since blob.mozSlice() is only needed for Firefox 12 and earlier, though I don't on which version did Safari start supporting File.prototype.slice (I tested that it works on Safari 11 which is the current latest version).

Closes #48

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 use `readAsBinaryString()`.

Also, chunked-file-reader always uses `File.prototype.slice`, but I think
that's ok now, since `blob.mozSlice()` is only needed for Firefox 12 and
earlier, though I don't on which version did Safari start supporting
`File.prototype.slice` (I tested that it works on Safari 11 which is the
current latest version).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant