- 授权协议: GPL
- 开发语言: C/C++ PHP
- 操作系统: 跨平台
- 软件首页: https://github.com/liexusong/unid
- 软件文档: https://github.com/liexusong/unid/blob/master/README.md
软件介绍
unid是一个可以生成唯一ID的php扩展,此扩展基于 Twitter Snowflake 算法。有兴趣可以了解一下这个算法: https://github.com/twitter/snowflake
功能列表:
// 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);
示例:
<?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;
?>$ cd ./unid $ phpize $ ./configure $ make $ sudo make install
php.ini 配置项:
[unid] unid.datacenter = int unid.twepoch = uint64
算法心得:高效算法的奥秘(原书第2版)
(美)Henry S. Warren, Jr. / 爱飞翔 / 机械工业出版社 / 2014-3 / 89.00
【编辑推荐】 由在IBM工作50余年的资深计算机专家撰写,Amazon全五星评价,算法领域最有影响力的著作之一 Google公司首席架构师、Jolt大奖得主Hoshua Bloch和Emacs合作创始人、C语言畅销书作者Guy Steele倾情推荐 算法的艺术和数学的智慧在本书中得到了完美体现,书中总结了大量高效、优雅和奇妙的算法,并从数学角度剖析了其背后的原理 【读者评价......一起来看看 《算法心得:高效算法的奥秘(原书第2版)》 这本书的介绍吧!
