mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-10 04:32:35 +01:00
🐛 fix Snowflake return bigint instead of string
This commit is contained in:
parent
ddfa1de983
commit
6df4b5e56b
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user