We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d449c36 commit fbe88fdCopy full SHA for fbe88fd
encryptcontent/decrypt-contents.tpl.js
@@ -1,9 +1,13 @@
1
/* encryptcontent/decrypt-contents.tpl.js */
2
{%- if webcrypto %}
3
// https://stackoverflow.com/a/50868276
4
-const fromHex = hexString => new Uint8Array(hexString.match(/.{1,2}/g).map(byte => parseInt(byte, 16)));
+function fromHex(hexString) {
5
+ return new Uint8Array(hexString.match(/.{1,2}/g).map(byte => parseInt(byte, 16)));
6
+}
7
// https://stackoverflow.com/a/41106346
-const fromBase64 = base64String => Uint8Array.from(atob(base64String), c => c.charCodeAt(0));
8
+function fromBase64(base64String) {
9
+ return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));
10
11
12
async function digestSHA256toBase64(message) {
13
const data = new TextEncoder().encode(message);
0 commit comments