shanginn / smolid
smol id generator
2.1.0
2023-12-10 08:07 UTC
Requires
- php: >=8.2
Requires (Dev)
- phpunit/phpunit: ^10.5
- symfony/var-dumper: ^7.0
This package is auto-updated.
Last update: 2024-12-10 10:19:39 UTC
README
Fast and secure unique smol ID generator, that look like this:
JIN5gNQEwht8999c4xZx9
88AFNNkR1RJI1gs8BBwxV
c54wMAUAR4wkFs9dN9Jts
Smaller than UUID and copy-paste friendly.
Usage
// Basic: $id = (new Smolid())->generate(); // Yd0AwdV80s8oRs0odN8hZ // Custom alphabet: $id = (new Smolid(alphabet: Alphabet::HEXADECIMAL_UPPERCASE))->generate(); // FE3782DA33AAA5ED96BEC // Custom size: $id = (new Smolid())->generate(size: 10); // N0BRRpNgpE
Inspired by Nano ID