summary refs log tree commit diff
path: root/gateway/src/util/SessionUtils.ts
diff options
context:
space:
mode:
authorAlTech98 <altech123159@gmail.com>2021-09-02 19:33:04 +0200
committerAlTech98 <altech123159@gmail.com>2021-09-02 19:33:04 +0200
commit8ff56b1f9e1b02c111ae725916f7e5be63d94662 (patch)
tree56907eb2747a362d26db4cfd6494bcaee234e7e6 /gateway/src/util/SessionUtils.ts
parent:art: update openapi title (diff)
downloadserver-8ff56b1f9e1b02c111ae725916f7e5be63d94662.tar.xz
VOICE_STATE_UPDATE implementation, fix #210
Diffstat (limited to '')
-rw-r--r--gateway/src/util/SessionUtils.ts11
1 files changed, 11 insertions, 0 deletions
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