[nscl] Replaced lib/sha256.js with web platform native implementation (thanks Martin for suggested patch).

This commit is contained in:
hackademix 2023-08-08 23:28:42 +02:00
parent 477eacab40
commit 1f7bbe48d9
No known key found for this signature in database
GPG Key ID: 231A83AFDA9C2434
3 changed files with 6 additions and 6 deletions

View File

@ -89,10 +89,10 @@ Messages.addHandler({
debug("COLLECT", list); debug("COLLECT", list);
return list; return list;
}, },
store(event) { async store(event) {
if (document.URL !== event.url) return; if (document.URL !== event.url) return;
let {data} = event; const {data} = event;
let attr = sha256(data.concat(Math.random())); const attr = await sha256(data.concat(Math.random()));
document.documentElement.dataset[attr] = data; document.documentElement.dataset[attr] = data;
return attr; return attr;
}, },

View File

@ -37,7 +37,7 @@
"scripts": [ "scripts": [
"/nscl/lib/browser-polyfill.js", "/nscl/lib/browser-polyfill.js",
"/nscl/lib/punycode.js", "/nscl/lib/punycode.js",
"/nscl/lib/sha256.js", "/nscl/common/sha256.js",
"/nscl/common/UA.js", "/nscl/common/UA.js",
"/nscl/common/uuid.js", "/nscl/common/uuid.js",
"/nscl/common/SyncMessage.js", "/nscl/common/SyncMessage.js",
@ -89,7 +89,7 @@
"all_frames": true, "all_frames": true,
"js": [ "js": [
"/nscl/lib/browser-polyfill.js", "/nscl/lib/browser-polyfill.js",
"/nscl/lib/sha256.js", "/nscl/common/sha256.js",
"/nscl/common/UA.js", "/nscl/common/UA.js",
"/nscl/common/uuid.js", "/nscl/common/uuid.js",
"/nscl/common/log.js", "/nscl/common/log.js",

@ -1 +1 @@
Subproject commit d85cc60cf297ad0012260975f3c1633279ddd012 Subproject commit 438bc9e3d2626521f8d669c32ddb0061fadcc4e5