Skip to content

Instantly share code, notes, and snippets.

@liangchaoboy
Created January 9, 2018 01:37
Show Gist options
  • Save liangchaoboy/4aaf295b029a1c2902c55449ef076ca9 to your computer and use it in GitHub Desktop.
Save liangchaoboy/4aaf295b029a1c2902c55449ef076ca9 to your computer and use it in GitHub Desktop.
crc32Blob: function (blob, cb){
var fr = new FileReader();
fr.onload = function(e){
cb(CRC32.buf(new Uint8Array(this.result)).toString(16));
};
fr.readAsArrayBuffer(blob);
}
post.filesize = chunk.size;
upload.crc32Blob(file.getNative(), function(crc32){
console.log(crc32);
post.crc32 = crc32;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment