calicastle/cuid
最新稳定版本:v2.0.0
Composer 安装命令:
composer require calicastle/cuid
包简介
A CUID generator
README 文档
README
A CUID (Collision Resistant Unique Identifier) is a method of creating a unique identifier that was developed by Eric Elliott. The purpose is to create unique IDs for use in web applications to better support horizontal scaling and sequential lookup performance.
Install
composer require calicastle/cuid
Example Usages
use CaliCastle\Cuid; Cuid::make(); // ckbe1q3gi000001jsfnm9cm81 Cuid::make('u'); // ukbe1qos1000201js74bwas75
Laravel Eloquent
use CaliCastle\Concerns\HasCuid; // Each user will have an id of something // like "ukbe1q3gi000001jsfnm9cm81" class User extends Model { use HasCuid; /** * Get the CUID prefix. */ public static function getCuidPrefix(): string { return 'u'; } }
统计信息
- 总下载量: 24.91k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-06-13