/**
* @Purpose:
* 创建唯一的uid
* @Method Name: create_guid()
*
* @Param:
*
* @Author: NoelXue
* @DATE:2017-10-13 14:52
* @Return:
/
public function create_guid(){
microTime=microtime();list(microTime = microtime();
list(microTime=microtime();list(a_dec, $a_sec) = explode(" ", $microTime);
dechex=dechex(dec_hex = dechex(dechex=dechex(a_dec 1000000);
sechex=dechex(sec_hex = dechex(sechex=dechex(a_sec);
this−>ensurelength(this->ensure_length(this−>ensurelength(dec_hex, 5);
this−>ensurelength(this->ensure_length(this−>ensurelength(sec_hex, 6);
$guid = “”;
$guid .= $dec_hex;
$guid .= $this->create_guid_section(3);
$guid .= $this->create_guid_section(4);
$guid .= $this->create_guid_section(4);
$guid .= $this->create_guid_section(4);
$guid .= $sec_hex;
$guid .= $this->create_guid_section(6);
return $guid;
}
dechex($one)十进制转为16进制,$res = str_pad($input, 10, "==")使用另一个字符串填充字符串为指定长度
最新推荐文章于 2023-02-25 14:00:42 发布