Skip to content

Commit f88a5bb

Browse files
Fix Buffer type check failures
Also ran `npm update @types/node --save-dev` to fix some type issues.
1 parent 0431053 commit f88a5bb

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

package-lock.json

Lines changed: 10 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/actions/usbsdfuTargetActions.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,9 @@ export const canWrite = (): AppThunk<RootState> => (dispatch, getState) => {
309309
* @param {MemoryMap} image the input memory map
310310
* @returns {Buffer} the calculated hash
311311
*/
312-
const calculateSHA256Hash = (image = new Uint8Array()) => {
312+
const calculateSHA256Hash = (
313+
image: Uint8Array<ArrayBufferLike> = new Uint8Array(),
314+
) => {
313315
const digest = Crypto.createHash('sha256');
314316
digest.update(image);
315317
return Buffer.from(digest.digest().reverse());
@@ -321,7 +323,9 @@ const calculateSHA256Hash = (image = new Uint8Array()) => {
321323
* @param {MemoryMap} image the input memory map
322324
* @returns {Buffer} the calculated hash
323325
*/
324-
const calculateSHA512Hash = (image = new Uint8Array()) => {
326+
const calculateSHA512Hash = (
327+
image: Uint8Array<ArrayBufferLike> = new Uint8Array(),
328+
) => {
325329
const digest = Crypto.createHash('sha512');
326330
digest.update(image);
327331
return Buffer.from(digest.digest().reverse());

0 commit comments

Comments
 (0)