IdGen

Twitter Snowflake-alike ID generator for .Net

MIT License

Stars
1.1K
Committers
4

Bot releases are hidden (Show)

IdGen - 3.0.7 Latest Release

Published by RobThree 5 months ago

Internal cleanup & minor changes. Fixed README & (package/README) logo issues

Full Changelog: https://github.com/RobThree/IdGen/compare/3.0.6...3.0.7

IdGen - 3.0.6

Published by RobThree 5 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/RobThree/IdGen/compare/3.0.5...3.0.6

IdGen - 3.0.5

Published by RobThree 8 months ago

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

IdGen - Minor internal changes, .netstandard 2.0 added.

Published by RobThree over 1 year ago

IdGen - Minor internal changes

Published by RobThree about 2 years 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.
IdGen - Minor internal changes

Published by RobThree over 2 years ago

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

IdGen - Improved and more consistent naming of objects.

Published by RobThree over 4 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)
IdGen - Fix concurrency issue

Published by RobThree over 4 years ago

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

IdGen - Implemented spinwaiting

Published by RobThree over 4 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.

IdGen - Bugfix & new TryCreate method

Published by RobThree over 4 years ago

Changes:

  • Added TryCreate() method (see #21)
  • Fix bug where different instances didn't share the same offset (see #20)
IdGen - NetStandard 1.1+ support, new IdGen.Configuration package, bugfix

Published by RobThree over 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, IdGento:IdGen.Configuration.IdGeneratorsSection, IdGen.Configuration
  • Add a using IdGen.Configuration
  • Change IdGenerator.GetFromConfig(...) to AppConfigFactory.GetFromConfig(...)
IdGen - Minor changes

Published by RobThree about 6 years ago

  • Added FromId() method to 'decode' an Id
  • Minor internal refactoring
IdGen - Flexible 'ticks'

Published by RobThree almost 8 years ago

Timesource(s) is (are) no longer fixed to 'millisecond resolution'; we now have the concept of a 'tick'. Each timesource can define it's own definition of what a 'tick' is, be it a millisecond or a minute or any other timespan.

This means breaking changes in the ITimeSource interface and the way timesources are implemented and breaking changes in some of the MaskConfig's method signatures.

The IIdGenerator<T> interface now explicitly exposes an IdGenerator's ITimeSource, MaskConfig and Epoch as (read-only) properties.

CreateMachineSpecificGenerator() & CreateThreadSpecificGenerator() methods have been removed; these are way to 'dangerous' to use anyway since they are very prone to 'collisions' in 'auto-generated' values for the IdGenerators.

IdGen - Improved DefaultTimeSource

Published by RobThree over 9 years ago

Moved away from DateTime.UtcNow and implemented a better, millisecond resolution, DefaultTimeSource using QueryPerformanceCounter.

IdGen - Initial release

Published by RobThree over 9 years ago