Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Cuid2 Laravel Package

visus/cuid2

PHP CUID2 generator for collision-resistant, secure, URL-safe IDs built for distributed systems. Uses SHA3-512 with time and entropy for scalable uniqueness. Supports instance or static usage plus identifier validation; GMP can improve performance.

View on GitHub
Deep Wiki
Context7
6.0.0

What's Changed

⚠️ Breaking Changes

  • Minimum PHP version increased from 8.1 to 8.2
  • Removed markrogoyski/math-php dependency - 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\Randomizer with Secure engine
  • Automatic bias-free sampling (eliminates manual rejection sampling)
  • Cleaner, more maintainable implementation

Base Conversion:

  • New Utils class 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.md with development guidelines
  • Updated README.md with 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: https://github.com/visus-io/php-cuid2/compare/5.2.0...6.0.0

5.2.0

What's Changed

  • Resolves #268
  • Resolves #271

[!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

5.1.1

What's Changed

  • General source code optimizations and cleanups

Full Changelog: https://github.com/visus-io/php-cuid2/compare/5.1.0...5.1.1

5.1.0

What's Changed

  • Fingerprint will 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: https://github.com/visus-io/php-cuid2/compare/5.0.0...5.1.0

5.0.0

What's Changed

  • The PHP extension GMP is now required to prevent precision loss during CUID generation. (#255)

Full Changelog: https://github.com/visus-io/php-cuid2/compare/4.1.0...5.0.0

4.1.0

What's Changed

  • Fingerprint class has been refactored to align with the implementation in cuid.net
  • Checks implemented in Cuid2 class to ensure that the hashing algorithm sha3-512 is 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: https://github.com/visus-io/php-cuid2/compare/4.0.0...4.1.0

4.0.0

What's Changed

  • Change license from Apache-2.0 to MIT

Full Changelog: https://github.com/visus-io/php-cuid2/compare/3.0.0...4.0.0

3.0.0

What's Changed

  • Sets minimum supported version of PHP to 8.1. Use 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

2.0.0
  • Migrate namespace from Xaevik to Visus to reflect change in ownership.
  • Drop support for PHP 7.4

Full Changelog: https://github.com/visus-io/php-cuid2/compare/1.7.0...2.0.0

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver