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 44f7ddf commit c6b24f6Copy full SHA for c6b24f6
src/utils/sha256.mjs
@@ -1,5 +1,9 @@
1
// https://stackoverflow.com/a/48161723/54547
2
export async function sha256(message) {
3
+ if (!crypto) {
4
+ throw new Error('Cryptography API unavailable. Please use HTTPS.');
5
+ }
6
+
7
// encode as UTF-8
8
const messageBuffer = new TextEncoder().encode(message);
9
0 commit comments