Update src/types/utils/snowflake.rs
Co-authored-by: SpecificProtagonist <specificprotagonist@posteo.org>
This commit is contained in:
parent
e64233e6d8
commit
0f300cfb20
|
@ -18,7 +18,7 @@ const EPOCH: i64 = 1420070400000;
|
||||||
pub struct Snowflake(u64);
|
pub struct Snowflake(u64);
|
||||||
|
|
||||||
impl Snowflake {
|
impl Snowflake {
|
||||||
/// Generates a snowflake for the current epoch.
|
/// Generates a snowflake for the current timestamp, with worker id 0 and process id 1.
|
||||||
pub fn generate() -> Self {
|
pub fn generate() -> Self {
|
||||||
const WORKER_ID: u64 = 0;
|
const WORKER_ID: u64 = 0;
|
||||||
const PROCESS_ID: u64 = 1;
|
const PROCESS_ID: u64 = 1;
|
||||||
|
|
Loading…
Reference in New Issue