1 Star 3 Fork 2

liexusong / unid

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

unid

PHP unique ID generator, based on the Twitter Snowflake algorithm!

functions list:

// 1) Get the next unique ID.
string unid_next_id(void);

// 2) Change unique ID to time stamp.
int unid_get_time(string id);

// 3) Change unique ID to worker id.
array unid_get_worker_id(string id);

example:

<?php
$id = unid_next_id();
echo $id;

$time = unid_get_time($id);
echo 'date time is: ' . date('Y-m-d H:i:s', $time);

$worker_id = unid_get_worker_id();
echo 'worker id is: ' . $worker_id;
?>

install:


$  cd ./unid
$  phpize
$  ./configure
$  make
$  sudo make install

php.ini configure entries:


[unid]
unid.datacenter = 1
unid.twepoch = "2016-07-01 00:00:00"

空文件

简介

unid是一个可以生成唯一ID的php扩展,此扩展基于“雪花算法” 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C
1
https://gitee.com/liexusong/unid.git
git@gitee.com:liexusong/unid.git
liexusong
unid
unid
master

搜索帮助