mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
5 lines
174 B
TypeScript
5 lines
174 B
TypeScript
export const randomString = (length: number, encoding?: BufferEncoding) =>
|
|
Buffer.from(crypto.getRandomValues(new Uint8Array(length))).toString(
|
|
encoding,
|
|
);
|