Releases: visus-io/php-cuid2
Releases · visus-io/php-cuid2
6.0.0
What's Changed
⚠️ Breaking Changes
- Minimum PHP version increased from 8.1 to 8.2
- Removed
markrogoyski/math-phpdependency - replaced with pure PHP implementation
✨ Performance & Architecture Improvements
CUID Generation:
- CUID value now generated in constructor and cached for zero-overhead repeated access
- Previously computed on-demand, now provides predictable performance characteristics
Fingerprint Refactor:
- Changed from array-based to binary string storage (SHA3-512 hash)
- Added singleton protections (
__clone,__wakeup) to prevent misuse - Platform-specific hostname length constants for Windows/Unix systems
- Improved documentation and type safety
Counter Improvements:
- Now uses PHP 8.2's
Random\RandomizerwithSecureengine - Automatic bias-free sampling (eliminates manual rejection sampling)
- Cleaner, more maintainable implementation
Base Conversion:
- New
Utilsclass with optimized base36 conversion algorithm - Uses intermediate large base (100 million) for efficient arithmetic
- Pure PHP implementation, zero external dependencies
- GMP still recommended for optimal performance
📚 Documentation
- Added comprehensive
CONTRIBUTING.mdwith development guidelines - Updated
README.mdwith improved documentation - Enhanced inline documentation across core classes
🔧 Maintenance
- Stronger composer cache key for CI
- Updated Renovate configuration
- Dependency updates via Renovate bot
Full Changelog: 5.2.0...6.0.0
5.2.0
What's Changed
- feat: introduce static generate method by @xaevik in #273
- feat: add isValid method for basic validation by @xaevik in #274
Note
The new Cuid2::isValid() method only guarantees that the value follows CUID2 format, it does not guarantee that it is actually a CUID2.
Full Changelog: 5.1.1...5.2.0
5.1.1
5.1.0
What's Changed
Fingerprintwill now take environment variables into account when generating a fingerprint.- The GMP PHP extension has returned to being optional.
- The dependency markrogoyski/math-php has been introduced as a viable fallback for when GMP is not available.
Full Changelog: 5.0.0...5.1.0
5.0.0
4.1.0
What's Changed
Fingerprintclass has been refactored to align with the implementation in cuid.net- Checks implemented in
Cuid2class to ensure that the hashing algorithmsha3-512is supported, otherwise it'll throw an\Exception
Note: Fingerprint generation no longer relies on $_SERVER variables containing IP addresses. This should alleviate any GDPR/CCPA concerns.
Full Changelog: 4.0.0...4.1.0
4.0.0
3.0.0
What's Changed
- Sets minimum supported version of PHP to 8.1. Use
2.xrelease if PHP 8.0 support is still required.
Full Changelog: 2.0.0...3.0.0
2.0.0
- Migrate namespace from
XaeviktoVisusto reflect change in ownership. - Drop support for PHP 7.4
Full Changelog: 1.7.0...2.0.0