From 9dac7ddf9eb43c4fac263d00b0208e6d337506fd Mon Sep 17 00:00:00 2001 From: AlTech98 Date: Thu, 2 Sep 2021 19:33:04 +0200 Subject: VOICE_STATE_UPDATE implementation, fix #210 --- gateway/src/util/SessionUtils.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 gateway/src/util/SessionUtils.ts (limited to 'gateway/src/util/SessionUtils.ts') diff --git a/gateway/src/util/SessionUtils.ts b/gateway/src/util/SessionUtils.ts new file mode 100644 index 00000000..1ca23316 --- /dev/null +++ b/gateway/src/util/SessionUtils.ts @@ -0,0 +1,11 @@ +export function genSessionId() { + return genRanHex(32) +} + +export function genVoiceToken() { + return genRanHex(16) +} + +function genRanHex(size: number) { + return [...Array(size)].map(() => Math.floor(Math.random() * 16).toString(16)).join(''); +} \ No newline at end of file -- cgit 1.5.1