himpun / utc-random
此包已被 弃用 且不再维护。未建议替代包。
PHP 实现CouchDB的 'utc-random' 算法。
1.0.1
2018-01-16 12:52 UTC
Requires
- php: >=7.1.0
Requires (Dev)
- phpbench/phpbench: ^0.14.0
- phpunit/phpunit: ^6.5
- squizlabs/php_codesniffer: ^3.2
This package is auto-updated.
Last update: 2018-06-27 03:53:42 UTC
README
此库是 CouchDB 的 utc-random
UUID 算法的 PHP 版本。此库的主要目的是在 PHP 应用程序中用于分布式 ID 生成,以提高可扩展性。
安装
可以通过在项目根目录下执行 composer require
命令轻松安装。
composer require himpun/utc-random
快速入门
// Include composer autoload
require 'vendor/autoload.php';
// Generate UUID through object instance
$utcRandom = new Himpun\UtcRandom;
$uuid = $utcRandom->generate();
// or through static method
$uuid = Himpun\UtcRandom::generate();
许可证
此库根据以下内容采用 MIT 许可。完整的许可证可以在 LICENSE
文件中找到。
MIT License
Copyright (c) 2018 Himpun
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.