ota_zip_get_info
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "ota_zip_get_info", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "", | ||
@@ -16,4 +16,5 @@ "main": "index.js", | ||
"dependencies": { | ||
"js-sha256": "^0.11.0", | ||
"jszip": "^3.10.1" | ||
} | ||
} |
@@ -0,6 +1,9 @@ | ||
import {sha256} from "js-sha256"; | ||
async function getHash(buffer) { | ||
const hashBuffer = await crypto.subtle.digest("SHA-256", buffer); | ||
const hashArray = Array.from(new Uint8Array(hashBuffer)); | ||
const hashHex = hashArray.map(b => b.toString(16).padStart(2, "0")).join(""); | ||
return hashHex; | ||
// const hashBuffer = await crypto.subtle.digest("SHA-256", buffer); | ||
// const hashArray = Array.from(new Uint8Array(hashBuffer)); | ||
// const hashHex = hashArray.map(b => b.toString(16).padStart(2, "0")).join(""); | ||
// return hashHex; | ||
return sha256(buffer) | ||
} | ||
@@ -7,0 +10,0 @@ |
6011
114
2
+ Addedjs-sha256@^0.11.0
+ Addedjs-sha256@0.11.0(transitive)