P

PHP 生成UUID

Bejix 代码笔记 2020-03-26
    public static function  uuid_gen()
    {
        $chars = md5(uniqid(mt_rand(), true));
        $uuid = substr($chars, 0, 8) . '-'
            . substr($chars, 8, 4) . '-'
            . substr($chars, 12, 4) . '-'
            . substr($chars, 16, 4) . '-'
            . substr($chars, 20, 12);
        return $uuid;
    }
PREV
PHP 生成MAC地址
NEXT
Python Flask 高并发部署(gevent)

评论(0)

发布评论