mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor(api): 🎨 Don't use node:crypto for random strings
This commit is contained in:
parent
d8cb1d475b
commit
d301d4da09
12 changed files with 37 additions and 35 deletions
4
utils/math.ts
Normal file
4
utils/math.ts
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
export const randomString = (length: number, encoding?: BufferEncoding) =>
|
||||
Buffer.from(crypto.getRandomValues(new Uint8Array(length))).toString(
|
||||
encoding,
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue