mysql中php生成唯一ID

<?php

  //uniqid官方手册
function create_guid($namespace = '') {
static $guid = '';
$uid = uniqid("", true);
$data = $namespace;
$data .= $_SERVER['REQUEST_TIME'];
$data .= $_SERVER['HTTP_USER_AGENT'];
$data .= $_SERVER['REMOTE_ADDR'];
$data .= $_SERVER['REMOTE_PORT'];
$hash = strtoupper(hash('ripemd128', $uid . $guid . md5($data)));
$guid = '{' .
substr($hash, , ) .
'-' .
substr($hash, , ) .
'-' .
substr($hash, , ) .
'-' .
substr($hash, , ) .
'-' .
substr($hash, , ) .
'}';
return $guid;
}
?>
上一篇:[Day3]Scanner类、Random类、流程控制语句


下一篇:Dev破解组件。