Interface ISnowflakeIDGenerator
- Namespace
- SnowflakeID
- Assembly
- SnowflakeIDGenerator.dll
Interface for the generator class for Snowflake.
This keeps track of time, machine number, and sequence.
[CLSCompliant(false)]
public interface ISnowflakeIDGenerator
Remarks
Properties
ConfiguredEpoch
Gets the date configured as the epoch for the generator.
DateTime ConfiguredEpoch { get; }
Property Value
Remarks
The epoch date is used as the starting point for generating unique IDs.
ConfiguredMachineId
Gets the configured machine ID for the generator.
int ConfiguredMachineId { get; }
Property Value
Remarks
The machine ID is used to ensure uniqueness across different instances of the generator.
Methods
GetCode()
Gets the next Snowflake ID as a number.
ulong GetCode()
Returns
Remarks
This method generates a new Snowflake ID and returns it as a numeric value.
GetCodeString()
Gets the next Snowflake ID as a string.
string GetCodeString()
Returns
Remarks
This method generates a new Snowflake ID and returns it as a string value.
GetSnowflake()
Generates the next Snowflake ID.
Snowflake GetSnowflake()
Returns
Remarks
This method generates a new Snowflake ID and returns it as a Snowflake object.