Releases: nrednav/cuid2
Releases · nrednav/cuid2
v1.1.0
What's changed
Added
- Added deterministic tests to verify the correctness of the ID generation algorithm
- Added an aggregate progress reporter to the collision test suite for better feedback during long test runs
Changed
- Security
- The default RNG has been updated to use the cryptographically secure
crypto/rand, instead of the insecuremath/rand - The library is now secure by default
- The default RNG has been updated to use the cryptographically secure
- Performance
- Optimized entropy generation by replacing inefficient string concatenation with usage of
strings.Builder. This reduces memory allocations. - Refactored collision test suite to use less memory.
- Optimized entropy generation by replacing inefficient string concatenation with usage of
- Other
- The
Generate()function is now initialized lazily and safely on first use viasync.Once - The long-running collision test has been separated from the default test suite via a build tag, to speed up testing during development
- The
Fixed
- The default fingerprint generation is now fully deterministic, as it sorts environment variable keys, ensuring the generated fingerprint is stable across different platforms
v1.0.1
What's Changed
- Updated validation regex for IsCuid() to include new criteria (must start with a letter)
- Updated crypto package to v0.17.0 via Dependabot
Full Changelog: v1.0.0...v1.0.1