Snowflake v0.0.1 Snowflake.Helper

The Helper module helps users work with snowflake IDs.

Helper module can do the following:

  • Deriving timestamp based on ID
  • Creating buckets based on days since epoch…

Summary

Functions

When no id is provided, we generate a bucket for the current time

Get bucket value based on segments of N days

Get timestamp in ms from epoch from any snowflake ID

Functions

bucket(units, unit_type)
bucket(integer, atom) :: integer

When no id is provided, we generate a bucket for the current time

bucket(units, unit_type, id)
bucket(integer, atom, integer) :: integer

Get bucket value based on segments of N days

timestamp_of_id(id)
timestamp_of_id(integer) :: integer

Get timestamp in ms from epoch from any snowflake ID