shoperti / cuid
针对横向扩展和性能优化的碰撞抵抗性ID。
v1.0.0
2015-10-05 20:45 UTC
Requires
- php: >=5.4.0
Requires (Dev)
- phpunit/phpunit: ~4.0
This package is auto-updated.
Last update: 2024-09-09 14:02:44 UTC
README
这是一个从https://github.com/ericelliott/cuid迁移到PHP的项目。请参考原始仓库以获取更多信息。
安装
首先通过Composer安装此包。编辑你的项目中的composer.json
文件,添加shoperti/cuid
依赖。
"require": { "shoperti/cuid": "~1.0" }
接下来,在终端中更新Composer
composer update
示例
// Create a new cuid $cuid = new Shoperti\Cuid\Cuid::cuid(); // Create a new cuid slug $cuid = new Shoperti\Cuid\Cuid::slug();