crc-32 not working for >5Gb file . Support for large files #8
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/js-crc32#8
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I was able to calculate the crc-32 using this for smaller files. However, for larger files, it is unable to calculate the crc-32 value. I was trying to calculate using 5 GB file.
How are you reading the file? The module is not allocating too much memory so it may be an issue with loading the data in the first place.
I am using ng-file-upload directive for picking the file and getting it's details.
https://github.com/danialfarid/ng-file-upload
@idnesh would it be possible to share a small demo using ng-file-upload and the crc-32 script? I can generate the large file manually, but I can't seem to load a file larger than 2 GB (chrome gives the "Aw, Snap!" error). Also, can you check whether you get the correct CRC32 for a 1 GB file?
If you are getting the data in chunks, make sure you repeatedly pass the previous CRC32 value, like in the example from https://github.com/SheetJS/js-crc32#usage :
@idnesh I tested against larger files and it appears to work correctly. A new web demo http://oss.sheetjs.com/js-crc32/large.html now reads the data by chunks. Using the IE8 Win7 Modern.IE VMware VM:
https://az412801.vo.msecnd.net/vhd/VMBuild_20141027/VMware/IE8/Windows/IE8.Win7.For.Windows.VMware.zip
You can verify against the webpage:
and the command line tool:
Keep in mind that the result is a signed 32 bit integer, and that may differ from your expectations if you are dealing with unsigned values. To convert to unsigned, just use
crc >>> 0
-- the demo performs that shift to show unsigned