jordimorillo/uid 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jordimorillo/uid

Composer 安装命令:

composer require jordimorillo/uid

包简介

A package to self-generate 32bit unique integer identifiers that can be used as primary keys in relational databases

README 文档

README

The goal for this package is:

  • To provide unique identifiers.
  • The identifiers will be integer so they can be used as primary keys in relational databases to keep performance.
  • Do not depend on third services to generate the Ids as happens with workers.
  • The generated identifier will be 32 bytes.

The current formula is:

UniqueId = php-object-identifier + random-integer + microtime

To this identifier gets repeated it should coincide the object identifier, the microtime, and a 7 number random integer. That is really very improbable but may happen in very rare ocasion.

Example of use:

<?php

use JordiMorillo\Uid\Uid;

class MyProductId extends Uid {}

$myProductId = new MyProductId();

echo "$myProductId"; //This should cast the identifier as a string of numbers

$myProductIdString = $myProductId->toString();

$anotherProductId = new MyProductId($myProductIdString); //This should be a similar equal as $myProductId

👤 Autor

Jordi Morillo SellsLinkedIn

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-only
  • 更新时间: 2021-02-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固