Snowflake
class Snowflake (View source)
Represents a Snowflake.
Constants
EPOCH |
Time since UNIX epoch to Discord epoch. |
Properties
static protected | $incrementIndex | ||
static protected | $incrementTime | ||
string|int | $value | The snowflake value. | |
float | $timestamp | The timestamp of when this snowflake got generated. In seconds with microseconds. | |
int | $workerID | The ID of the worker which generated this snowflake. | |
int | $processID | The ID of the process which generated this snowflake. | |
int | $increment | The increment index of the snowflake. | |
string | $binary | The binary representation of this snowflake. | |
DateTime | $date | A DateTime instance of the timestamp. |
Methods
__construct(string|int $snowflake)
Constructor.
mixed
__get($name)
No description
static Snowflake
deconstruct(string|int $snowflake)
Deconstruct a snowflake.
static string
generate(int $workerID = 1, int $processID = 0)
Generates a new snowflake.
int
getShardID(int $shardCount)
Compute the shard ID from the snowflake.