Crate spaceflake

Source

Structs§

BulkGeneratorSettings
Settings to bulk generate Spaceflakes easily.
GeneratorSettings
Settings to generate Spaceflakes normally.
Node
A node holds multiple Worker structures and has a, ideally, unique ID given.
Spaceflake
A Spaceflake is the internal name for a Snowflake ID.
Worker
A worker is the a structure that is responsible to generate the Spaceflake.

Constants§

EPOCH
The default epoch used with milliseconds, which is the 1st of January 2015 at 12:00:00 AM GMT.

Functions§

bulk_generate
Generate an amount of Spaceflakes for the given settings.
decompose
Decompose a Spaceflake ID, and get a key-value hashmap with each part of a Spaceflake.
decompose_binary
Decompose a Spaceflake ID, and get a key-value hashmap with each part of a Spaceflake in binary.
generate
Generate a Spaceflake for the given settings.
generate_at
Generate a Spaceflake for the given settings at a specific time.
parse_node_id
Parse the node ID of a Spaceflake ID.
parse_sequence
Parse the sequence of a Spaceflake ID.
parse_time
Parse the time of a Spaceflake ID.
parse_worker_id
Parse the worker ID of a Spaceflake ID.