Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fireshare",
"version": "1.2.27",
"version": "1.2.28",
"private": true,
"dependencies": {
"@emotion/react": "^11.9.0",
Expand Down
5 changes: 4 additions & 1 deletion app/client/src/components/admin/UploadCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ const UploadCard = ({ authenticated, feedView = false, publicUpload = false, fet
if (!selectedFile) return;

const totalChunks = Math.ceil(selectedFile.size / chunkSize);
const checksum = await crypto.subtle.digest('SHA-256', await selectedFile.arrayBuffer()).then(buf => Array.from(new Uint8Array(buf)).map(b => b.toString(16).padStart(2, '0')).join(''));

const fileInfo = `${selectedFile.name}-${selectedFile.size}-${selectedFile.lastModified}`;
const checksum = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(fileInfo))
.then(buf => Array.from(new Uint8Array(buf)).map(b => b.toString(16).padStart(2, '0')).join(''));

try {
for (let chunkIndex = 0; chunkIndex < totalChunks; chunkIndex++) {
Expand Down