summary refs log tree commit diff
path: root/src/util/Snowflake.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-01 16:54:16 +0100
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-01 16:54:16 +0100
commit6df4b5e56ba35a561d7878325b6e58001ce3fc8e (patch)
tree63e844444db0c3a2fa269ab36c4a95ac5f3728da /src/util/Snowflake.ts
parent:zap: Snowflake generate improve performance with BigInt (diff)
downloadserver-6df4b5e56ba35a561d7878325b6e58001ce3fc8e.tar.xz
:bug: fix Snowflake return bigint instead of string
Diffstat (limited to 'src/util/Snowflake.ts')
-rw-r--r--src/util/Snowflake.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/Snowflake.ts b/src/util/Snowflake.ts

index f329a1d5..9e94bbd9 100644 --- a/src/util/Snowflake.ts +++ b/src/util/Snowflake.ts
@@ -10,7 +10,7 @@ * A container for useful snowflake-related methods. */ export class Snowflake { - static readonly EPOCH = 1420070400000n; + static readonly EPOCH = 1420070400000; static INCREMENT = 0n; // max 4095 static processId = 0n; // max 31 static workerId = 0n; // max 31 @@ -87,7 +87,7 @@ export class Snowflake { var worker = Snowflake.workerId << 17n; var process = Snowflake.processId << 12n; var increment = Snowflake.INCREMENT++; - return (time | worker | process | increment).toString(10); + return time | worker | process | increment; } /**