PHP生成 uuid
// 生成UUID,并去掉分割符
function guid() {
if (function_exists('com_create_guid')){
$uuid = com_create_guid();
}else{
mt_srand((double)microtime()*);//optional for php 4.2.0 and up.
$charid = strtoupper(md5(uniqid(rand(), true)));
$hyphen = chr();// "-"
$uuid = chr()// "{"
.substr($charid, , ).$hyphen
.substr($charid, , ).$hyphen
.substr($charid,, ).$hyphen
.substr($charid,, ).$hyphen
.substr($charid,,)
.chr();// "}"
}
$uuid = str_replace(array('-', '{', '}'), '', $uuid);
return $uuid;
}
PHP生成 uuid的更多相关文章
- Java 生成 UUID
1.UUID 简介 UUID含义是通用唯一识别码 (Universally Unique Identifier),这是一个软件建构的标准,也是被开源软件基金会 (Open Software Found ...
- php生成UUID
UUID含义是 通用唯一识别码 (Universally Unique Identifier),这 是一个软件建构的标准,也是被开源软件基金会 (Open Software Foundation, O ...
- JS生成UUID的方法实例
<!DOCTYPE html> <html> <head> <script src="http://libs.baidu.com/jquery/1. ...
- linux c 生成uuid
/********方法一**********/#include <stdio.h> #include <stdlib.h> #include <string.h> ...
- java 生成UUID
UUID(Universally Unique Identifier)全局唯一标识符,是一个128位长的数字,一般用16进制表示. 算法的核心思想是结合机器的网卡.当地时间.一个随即数来生成UUID, ...
- Oracle数据库生成UUID
从Data Ghost的blog得知,原来可以用Oracle来生成UUID,做法很简单,如下: select sys_guid() from dual; 数据类型是 raw(16) 有32个字符.
- java生成UUID通用唯一识别码 (Universally Unique Identifier)
转自:http://blog.csdn.net/carefree31441/article/details/3998553 UUID含义是通用唯一识别码 (Universally Unique Ide ...
- (转)java生成UUID通用唯一识别码 (Universally Unique Identifier)
(原文链接:http://blog.csdn.net/carefree31441/article/details/3998553) UUID含义是通用唯一识别码 (Universally Uniq ...
- js 生成 UUID
在项目中遇到要生成 UUID 的需求,第一反应就是有没有原生的生成方法,找了找,发现没有,只能自己建立算法 function. 下面是我用的算法 function uuid(len, radix) { ...
随机推荐
- Coredata中的多线程
=================== 疑问: 1.coredata是什么?结构 2.如果在简单的demo中,我们可以在主线程中使用coredata.但是如果在真正的大项目中,这样可行么? 3.假设都 ...
- .2-Vue源码起步(2)
接着第一节开始继续吧(GoGoGo) 上一节把mergeOptions函数弄完了,最后返回一个options赋给了vm.$options. 这一节继续跑代码: function initMixin(V ...
- ASP.NET Core中间件实现分布式 Session
1. ASP.NET Core中间件详解 1.1. 中间件原理 1.1.1. 什么是中间件 1.1.2. 中间件执行过程 1.1.3. 中间件的配置 1.2. 依赖注入中间件 1.3. Cookies ...
- ES6新特性 Class的实现
ES5之前类的继承是靠原型实现的,而这一过程的实现又涉及到一大堆的原型定义,特别是ES5推出了Object.definePorperty()方法后,代码更加晦涩.但是这种方式正是javascript这 ...
- Leetcode题解(23)
69. Sqrt(x) 题目 分析,题目实现求一个int数的平方根,最暴力的算法就是逐个遍历,从1开始到x,判断是否有一个数i,其中满足i*i<=x,并且(i+1)*(i+1)>x;这个算 ...
- Problem X
Problem Description Recently, iSea went to an ancient country. For such a long time, it was the most ...
- 第十一章 多GPU系统的CUDA C
本章介绍了 显存和零拷贝内存的拷贝与计算对比 #include <stdio.h> #include "cuda_runtime.h" #include "d ...
- maven构建geotools应用工程
前置条件 jdk1.7+eclipse+maven POM配置 <project xmlns="http://maven.apache.org/POM/4.0.0" xmln ...
- Python的__main__.py用法
[背景] 在看flower的时候看到__main__.py文件,不知道具体做什么用? 故先进行测试看看. [测试代码] 测试代码目录结构如下: . `-- test |-- __init__.py | ...
- STM32学习方法
1.网络学习资源 WWW.openedv.com 开源电子网 WWW.stmcu.org ST中国官方技术网站,ST官方文档发布网站 微信公众平台 正 ...