Download the PHP package qs9000/think-uuidv7 without Composer

On this page you can find all versions of the php package qs9000/think-uuidv7. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package think-uuidv7

think-uuidv7

基于 ThinkPHP 8 的 UUIDv7 生成器,专为分布式系统设计。

特性

安装

安装后自动完成:

快速开始

1. 注册服务(可选)

如果自动注册失败,在 application/provider.php 中手动注册:

2. 配置

配置文件已自动生成在 config/uuidv7.php:

3. 生成 UUID

4. 解析 UUID

5. 二进制格式

数据库存储使用 BINARY(16) 而非 CHAR(36):

ThinkPHP 模型集成

类型转换器

在模型中定义 uuidv7 类型字段:

工作原理:

数据库迁移

UUID 结构

字段 位长 说明
timestamp 48bit 毫秒级时间戳(自 Unix 纪元)
version 4bit 版本号,固定为 7
rand_a 12bit shard_id(8bit高) + seq_high(4bit低)
sequence 40bit 毫秒内序列号(Redis支持40bit,本地12bit)
variant 2bit 变种位,固定为 10
rand_b 14bit seq_low(8bit) + random(6bit)
rand_c 48bit 随机数

说明:

时间戳提取

分布式配置

多节点部署

每个服务器设置唯一的 shard_id:

Redis 配置

性能特性

场景 单次生成 批量生成 (100)
本地模式 ~0.02ms ~0.5ms
Redis 模式 ~0.1ms ~1ms

容量分析

存储方式 序列号容量 时间范围
本地模式 4,096/毫秒 无限(按 shard_id 分片)
Redis 模式 1万亿/毫秒 约 35,000 年

CLI 命令

测试

依赖

License

Apache-2.0


All versions of think-uuidv7 with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
topthink/framework Version ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package qs9000/think-uuidv7 contains the following files

Loading the files please wait ...