4 Star 12 Fork 8

DIYGW可视化平台/diygwcom_app

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
DiygwcomUtil.class.php 1.12 KB
一键复制 编辑 原始数据 按行查看 历史
html580 提交于 2018-08-03 16:18 +08:00 . 初始化版本
<?php
/*
* @Author: DIYGWCOM
* @Date: 2018-05-25 00:58:42
* @qq: 287598666
* @Last Modified by: DIYGWCOM
* @Last Modified time: 2018-05-25 01:03:48
*/
/**
* 工具类
*/
class DiygwcomUtil{
public static $DEBUG = false;
/**
* 转换移动端url
* @param string $url 移动端相对地址/绝对地址
* @return string 转换后的url
*/
public static function to_mobile_url($url){
global $_W;
return $_W['siteroot'] . 'app' . str_replace('./', '/', $url);
}
/**
* 生成基于MD5随机字符串
* @param string $namespace 字符串前缀
* @return string 随机字符串
*/
public static function create_guid($namespace = '') {
static $guid = '';
$uid = uniqid("", true);
$data = $namespace;
$data .= $_SERVER['REQUEST_TIME'];
$data .= $_SERVER['HTTP_USER_AGENT'];
$data .= $_SERVER['LOCAL_ADDR'];
$data .= $_SERVER['LOCAL_PORT'];
$data .= $_SERVER['REMOTE_ADDR'];
$data .= $_SERVER['REMOTE_PORT'];
$hash = strtoupper(hash('ripemd128', $uid . $guid . md5($data)));
$guid = date('Ymdhis',time()).substr($hash, 0, 8);
return $guid;
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/diygw/diygwcom_app.git
[email protected]:diygw/diygwcom_app.git
diygw
diygwcom_app
diygwcom_app
master

搜索帮助