refactor(api): 🎨 Don't use node:crypto for random strings

This commit is contained in:
Jesse Wierzbinski 2024-06-12 19:38:26 -10:00
parent d8cb1d475b
commit d301d4da09
No known key found for this signature in database
12 changed files with 37 additions and 35 deletions

4
utils/math.ts Normal file
View file

@ -0,0 +1,4 @@
export const randomString = (length: number, encoding?: BufferEncoding) =>
Buffer.from(crypto.getRandomValues(new Uint8Array(length))).toString(
encoding,
);