visus/cuid2
A PHP implementation of CUID2 for generating secure, URL-safe, collision-resistant identifiers across multiple machines without coordination. Includes instance-based and static APIs plus built-in validation.
symfony/polyfill-php83 dependency — no longer needed now that PHP 8.3 is the floorBase36 Conversion:
Cuid2::convert() now reads the raw SHA3-512 digest bytes directly instead of building an intermediate hex string firstUtils::bytesToBase36() method — the pure-PHP fallback path now packs the digest into base-2³² limbs and divides by 36⁵ per pass, extracting 5 base36 digits at once (about 5x fewer full array scans than before)Utils::hexToBase36() remains available as a public entry point for callers that still have a hex string, sharing core logic with bytesToBase36()gmp_import()/gmp_strval()) and the pure-PHP path continue to produce identical outputFull Changelog: https://github.com/visus-io/php-cuid2/compare/6.0.0...7.0.0
markrogoyski/math-php dependency - replaced with pure PHP implementationCUID Generation:
Fingerprint Refactor:
__clone, __wakeup) to prevent misuseCounter Improvements:
Random\Randomizer with Secure engineBase Conversion:
Utils class with optimized base36 conversion algorithmCONTRIBUTING.md with development guidelinesREADME.md with improved documentationFull Changelog: https://github.com/visus-io/php-cuid2/compare/5.2.0...6.0.0
[!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: https://github.com/visus-io/php-cuid2/compare/5.1.1...5.2.0
Full Changelog: https://github.com/visus-io/php-cuid2/compare/5.1.0...5.1.1
Fingerprint will now take environment variables into account when generating a fingerprint.Full Changelog: https://github.com/visus-io/php-cuid2/compare/5.0.0...5.1.0
Full Changelog: https://github.com/visus-io/php-cuid2/compare/4.1.0...5.0.0
Fingerprint class has been refactored to align with the implementation in cuid.netCuid2 class to ensure that the hashing algorithm sha3-512 is supported, otherwise it'll throw an \ExceptionNote: Fingerprint generation no longer relies on $_SERVER variables containing IP addresses. This should alleviate any GDPR/CCPA concerns.
Full Changelog: https://github.com/visus-io/php-cuid2/compare/4.0.0...4.1.0
Apache-2.0 to MITFull Changelog: https://github.com/visus-io/php-cuid2/compare/3.0.0...4.0.0
2.x release if PHP 8.0 support is still required.Full Changelog: https://github.com/visus-io/php-cuid2/compare/2.0.0...3.0.0
Xaevik to Visus to reflect change in ownership.Full Changelog: https://github.com/visus-io/php-cuid2/compare/1.7.0...2.0.0
How can I help you explore Laravel packages today?