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 12dcdaf commit 51a8eb8Copy full SHA for 51a8eb8
cf/polyfills.js
@@ -439,9 +439,8 @@ if (md5('hello') != '5d41402abc4b2a76b9719d911017c592') {
439
*/
440
441
const sha256 = (x) => {
442
- return Crypto.subtle.digest("SHA-256", textEncoder.encode(x)).then((digest) =>
443
- Array.from(new Uint8Array(digest))
444
- .map((b) => b.toString(16).padStart(2, "0"))
445
- .join("")
446
- )
+ let message = x
+ if (!(x instanceof Uint8Array))
+ message = textEncoder.encode(x)
+ return Crypto.subtle.digest("SHA-256", message)
447
}
package.json
@@ -56,4 +56,4 @@
56
"pg",
57
"database"
58
]
59
-}
+}
0 commit comments