nicoorfi / prefix-id
Generate unique, URL-safe, alphanumeric IDs with a specified prefix.
v1.0.1
2024-07-24 08:11 UTC
Requires
- php: ^8.0
Requires (Dev)
- phpunit/phpunit: >=8.0
- squizlabs/php_codesniffer: ^3.0
- symfony/var-dumper: ^6.0
README
This is a PHP library for generating unique, URL-safe, alphanumeric IDs with a specified prefix. This is useful for generating unique identifiers for various resources in web applications.
Installation
You can install the package via Composer:
composer require nicoorfi/prefix_id
Usage
<?php require 'vendor/autoload.php'; $token = prefix_id(prefix: 'sgm', length: 24) echo $token // sgm_MF0e5Ng0xJc1zMv3A0T4f0n2