ncuid
ncuid copied to clipboard
Collision-resistant ids for .NET (port of https://github.com/dilvie/cuid)
Due to security concerns (which also exist in database auto-increment ids, uuid/guid, and most other id standards), the Cuid standard is now deprecated in favor of [Cuid2](https://github.com/paralleldrive/cuid2).
` var ts = DateTime.Now.ToUnixMilliTime().ToBase36(); ` It should use DateTime.UtcNow here as the Epoch time used is also Utc.
Refactored random block generation logic to avoid recreation of Random class. (deals with issue in tracker) Use of Random class is now thread-safe (using thread-local wrapper). Random class is initialised...
There is a warning when referencing the NCuid package from a net core project: ``` NU1701 Package 'NCuid 1.0.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of...
For this line, https://github.com/moonpyk/ncuid/blob/9f5efe059646cc4c9ab1952216c907a6f058b78a/NCuid/Cuid.cs#L127 Should it be hostname.ToCharArray().Select(c=>c.ToString()) instead? I tried the existing code and found that it just returned ["hostname"], where hostname is my hostname value.
At https://github.com/moonpyk/ncuid/blob/master/NCuid/Cuid.cs#L104, you create a new instance of `Random` every time the method is called. If I call it in a loop very quickly, then that part of the cuid...