aboutsummaryrefslogtreecommitdiff
path: root/client/public/crypto.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/public/crypto.ts')
-rw-r--r--client/public/crypto.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/client/public/crypto.ts b/client/public/crypto.ts
index ab83517..476d713 100644
--- a/client/public/crypto.ts
+++ b/client/public/crypto.ts
@@ -3,7 +3,6 @@ import { hkdf } from '@noble/hashes/hkdf.js'
import { pbkdf2 } from '@noble/hashes/pbkdf2.js'
import { sha256 } from '@noble/hashes/sha2.js'
import { gcm } from '@noble/ciphers/aes.js'
-import { randomBytes as nodeRandomBytes } from 'node:crypto'
const B64URL = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'
@@ -77,7 +76,8 @@ function randomBytes(n: number): Uint8Array {
(_g['crypto'] as Crypto).getRandomValues(buf)
return buf
}
- return new Uint8Array(nodeRandomBytes(n))
+ // what can i do.
+ return new Uint8Array(new Array(n).fill(0).map(e => Math.floor(Math.random() * 256)))
}
const _wc: Record<string, boolean | undefined> = {}