From a4fdaf0352e396fcc5660837b7a5364a6d07f96b Mon Sep 17 00:00:00 2001 From: Erkin Alp Güney Date: Tue, 30 Nov 2021 21:53:50 +0300 Subject: fix the bigint asintn --- api/src/util/RandomInviteID.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'api/src') diff --git a/api/src/util/RandomInviteID.ts b/api/src/util/RandomInviteID.ts index d8ea8473..410c5169 100644 --- a/api/src/util/RandomInviteID.ts +++ b/api/src/util/RandomInviteID.ts @@ -24,7 +24,7 @@ export function snowflakeBasedInvite() { let str = ""; for (let i=0; i < 10; i++) { - str += chars.charAt(BigInt.asUintN(snowflake % base)); + str += chars.charAt(BigInt.asUintN(32, snowflake % base)); snowflake = snowflake / base; } -- cgit 1.5.1 From dabe8f501ca95c8c437228b342c08ccf9e8f7d4a Mon Sep 17 00:00:00 2001 From: Erkin Alp Güney Date: Tue, 30 Nov 2021 22:04:48 +0300 Subject: Eventually fixed all the errors in the RandomInviteID --- api/src/util/RandomInviteID.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'api/src') diff --git a/api/src/util/RandomInviteID.ts b/api/src/util/RandomInviteID.ts index 410c5169..7ea344e0 100644 --- a/api/src/util/RandomInviteID.ts +++ b/api/src/util/RandomInviteID.ts @@ -24,7 +24,7 @@ export function snowflakeBasedInvite() { let str = ""; for (let i=0; i < 10; i++) { - str += chars.charAt(BigInt.asUintN(32, snowflake % base)); + str.concat(chars.charAt(Number(snowflake % base))); snowflake = snowflake / base; } -- cgit 1.5.1