phpgt/ulid
最新稳定版本:v1.2.1
Composer 安装命令:
composer require phpgt/ulid
包简介
Unique, lexicographically sortable identifiers.
README 文档
README
Create a new Ulid() anywhere in your application, and you have a stringable object that can be used as the primary key in a database. Ulid strings look something like 01G2J6MYN0PGC5Q21W9C or can be prefixed with a type like CUSTOMER_01G2J6MYN0PGC5Q21W9C. They are cryptographically pseudo-random, and sort so that newer Ulids compare "greater than" older Ulids.
This solves the problems exposed with working with auto-incrementing integer primary keys, which are predictable and difficult to work with in distributed databases.
Example usage:
use Gt\Ulid\Ulid; $exampleDataSource->create(new Person( new Ulid("pet"), name: "Cody", age: 5, ));
Proudly sponsored by
统计信息
- 总下载量: 1.75k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-05-08