summaryrefslogtreecommitdiff
path: root/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'utils.js')
-rw-r--r--utils.js11
1 files changed, 0 insertions, 11 deletions
diff --git a/utils.js b/utils.js
deleted file mode 100644
index ed21d46..0000000
--- a/utils.js
+++ /dev/null
@@ -1,11 +0,0 @@
-export function randomString() {
- return Math.random().toString(36).substr(2)
-}
-
-export async function sha256(input) {
- const encoder = new TextEncoder()
- const inputBytes = encoder.encode(input)
- const outputBuffer = await crypto.subtle.digest('SHA-256', inputBytes)
- const outputArray = Array.from(new Uint8Array(outputBuffer))
- return outputArray.map(b => b.toString(16).padStart(2, '0')).join('')
-}