From a2df9a69dcc14cb70118cda2ded499055e7ee358 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sun, 21 Aug 2022 17:31:56 +0200 Subject: m. update --- together/src/utils/PartyCodes.ts | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 together/src/utils/PartyCodes.ts (limited to 'together/src/utils/PartyCodes.ts') diff --git a/together/src/utils/PartyCodes.ts b/together/src/utils/PartyCodes.ts new file mode 100644 index 0000000..1acc82e --- /dev/null +++ b/together/src/utils/PartyCodes.ts @@ -0,0 +1,5 @@ +import {randomBytes} from 'crypto'; + +export function generateParyCode(): string { + return parseInt(randomBytes(16).toString("hex"), 16).toString(36).substring(0, 8); +} \ No newline at end of file -- cgit