IdGen Versions Save

Twitter Snowflake-alike ID generator for .Net

3.0.5

1 month ago

This is a maintenance release. No changes in packages. From now on we use GitHub actions to build and publish Nuget packages.

3.0.3

1 year ago

3.0.2

1 year ago

Minor internal refactoring.

  • ID is now a record
  • Fixed bounds check where when the GeneratorId was 31 bits the constructor would throw on any generator id.

3.0.1

1 year ago

Minor internal refactoring. Also an Idgen.DependencyInjection package is now available.

3.0.0

3 years ago

This release contains a few (minor) breaking changes. Generated 2.x ID's are still compatible with 3.x ID's.

  • Most of the constructor overloads for the IdGenerator have been replaced with a single constructor which accepts IdGeneratorOptions that contains the ITimeSource, IdStructure and SequenceOverflowStrategy.
  • The MaskConfig class is now more appropriately named IdStructure since it describes the structure of the generated ID's.
  • The UseSpinWait property has moved to the IdGeneratorOptions and is now an enum of type SequenceOverflowStrategy instead of a boolean value. Note that this property has also been renamed in the config file (from useSpinWait to sequenceOverflowStrategy) and is no longer a boolean but requires one of the values from SequenceOverflowStrategy.
  • ID is now Id (only used as return value by the FromId(...) method)

2.4

3 years ago

Fix concurrency issue (see PR #23). Upped version.

2.4.1

3 years ago

The IdGenerator now offers a spinwaiting strategy when a sequenceoverflow occurs instead of throwing a SequenceOverflowException. This will spinwait until the next tick and then return a new Id. New constructoroverloads have been added to be able to set this property at construction time. Also the configuration package supports this new option with a useSpinWait attribute on the idGenerator element.

2.3

4 years ago

Changes:

  • Added TryCreate() method (see #21)
  • Fix bug where different instances didn't share the same offset (see #20)

2.1

4 years ago

Changes:

  • Support for NetStandard 1.1+
  • Moved AppConfig stuff to separate IDGen.Configuration package
  • ID now implements IEquatable
  • Fixed some ArgumentOutOfRangeExceptions from the IdGenerator's ctor messages
  • Fixed bug (see #18) where internal timer was started only on first use instead of on instantiation. Thanks @stuart-beattie!
  • Minor internal cleanup / refactoring

Breaking changes:

If you're using the IdGenerator.GetFromConfig(...) method make sure you check the README. The changes aren't big, but breaking nonetheless. How to fix:

  • Install IdGen.Configuration package
  • Change the configsection type from:
    IdGen.Configuration.IdGeneratorsSection, IdGen
    to:
    IdGen.Configuration.IdGeneratorsSection, IdGen.Configuration
  • Add a using IdGen.Configuration
  • Change IdGenerator.GetFromConfig(...) to AppConfigFactory.GetFromConfig(...)

2.0.3

5 years ago
  • Added FromId() method to 'decode' an Id
  • Minor internal refactoring