Skip to content

Commit 76eec14

Browse files
authored
Merge pull request #320 from ShaneIsrael/develop
Develop
2 parents 570ab52 + ad94cce commit 76eec14

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

app/client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fireshare",
3-
"version": "1.2.27",
3+
"version": "1.2.28",
44
"private": true,
55
"dependencies": {
66
"@emotion/react": "^11.9.0",

app/client/src/components/admin/UploadCard.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ const UploadCard = ({ authenticated, feedView = false, publicUpload = false, fet
9898
if (!selectedFile) return;
9999

100100
const totalChunks = Math.ceil(selectedFile.size / chunkSize);
101-
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(''));
101+
102+
const fileInfo = `${selectedFile.name}-${selectedFile.size}-${selectedFile.lastModified}`;
103+
const checksum = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(fileInfo))
104+
.then(buf => Array.from(new Uint8Array(buf)).map(b => b.toString(16).padStart(2, '0')).join(''));
102105

103106
try {
104107
for (let chunkIndex = 0; chunkIndex < totalChunks; chunkIndex++) {

0 commit comments

Comments
 (0)