File tree 3 files changed +4
-4
lines changed
3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 18
18
"@fontsource-variable/inter" : " ^5.0.18" ,
19
19
"@fontsource-variable/jetbrains-mono" : " ^5.0.21" ,
20
20
"comlink" : " ^4.4.1" ,
21
- "jssha " : " ^3.3.1 " ,
21
+ "hash-wasm " : " ^4.12.0 " ,
22
22
"react" : " ^18.3.1" ,
23
23
"react-dom" : " ^18.3.1" ,
24
24
"xz-decompress" : " ^0.2.1"
Original file line number Diff line number Diff line change 1
1
import * as Comlink from 'comlink'
2
2
3
- import jsSHA from 'jssha '
3
+ import { createSHA256 } from 'hash-wasm '
4
4
import { XzReadableStream } from 'xz-decompress'
5
5
6
6
/**
@@ -133,7 +133,7 @@ const imageWorker = {
133
133
}
134
134
}
135
135
136
- const shaObj = new jsSHA ( 'SHA-256' , 'UINT8ARRAY' )
136
+ const shaObj = await createSHA256 ( )
137
137
let complete
138
138
try {
139
139
let stream = archiveFile . stream ( )
@@ -166,7 +166,7 @@ const imageWorker = {
166
166
throw `Error closing file handle: ${ e } `
167
167
}
168
168
169
- const checksum = shaObj . getHash ( 'HEX' )
169
+ const checksum = shaObj . digest ( )
170
170
if ( checksum !== expectedChecksum ) {
171
171
throw `Checksum mismatch: got ${ checksum } , expected ${ expectedChecksum } `
172
172
}
You can’t perform that action at this time.
0 commit comments