当前位置: 首页 > news >正文

全球速卖通注册条件沧州网站优化

全球速卖通注册条件,沧州网站优化,网站建设遇到问题解决方案,苏州小程序对于想隐藏真实id的需求,比如想加密userId等 使用示例: * 不指定长度* AlphaIDCustom(12354); //会将数字转换为字母。* AlphaIDCustom(PpQXn7COf,true);//会将字母ID转换为对应的数字。* 指定长度* Alpha…

对于想隐藏真实id的需求,比如想加密userId等
使用示例:

	 * 不指定长度* AlphaIDCustom(12354);  //会将数字转换为字母。* AlphaIDCustom('PpQXn7COf',true);//会将字母ID转换为对应的数字。* 指定长度* AlphaIDCustom(123456,false,6);//指定生成字母ID的长度为6.* AlphaIDCustom('xyMSSI',ture,6);//会将字母ID转换为对应的数字.

源码:

    /*** 数字ID和字符串ID互相转换* 如:* 不指定长度* AlphaIDCustom(12354);  //会将数字转换为字母。* AlphaIDCustom('PpQXn7COf',true);//会将字母ID转换为对应的数字。* 指定长度* AlphaIDCustom(123465,false,6);//指定生成字母ID的长度为6.* AlphaIDCustom('xyMSSI',ture,6);//会将字母ID转换为对应的数字.* @param $in* @param false $to_num 是否转成数字* @param false $pad_up 长度限制* @param null $passKey 加密* @return false|string*/function AlphaIDCustom($in, $to_num = false, $pad_up = false, $passKey = null){
//        $index = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";//乱序$index = 'SITEQZFyWtpPjRxVYc7uL094bOA8rDCBMmgki23XJnsfHd5oqNwzhUlGKave61';if ($passKey !== null) {for ($n = 0; $n<strlen($index); $n++) {$i[] = substr( $index,$n ,1);}$passhash = hash('sha256',$passKey);$passhash = (strlen($passhash) < strlen($index))? hash('sha512',$passKey): $passhash;for ($n=0; $n < strlen($index); $n++) {$p[] =  substr($passhash, $n ,1);}array_multisort($p,  SORT_DESC, $i);$index = implode($i);}$base  = strlen($index);if ($to_num) {// Digital number  <<--  alphabet letter code$in  = strrev($in);$out = 0;$len = strlen($in) - 1;for ($t = 0; $t <= $len; $t++) {$bcpow = bcpow($base, $len - $t);$out   = $out + strpos($index, substr($in, $t, 1)) * $bcpow;}if (is_numeric($pad_up)) {$pad_up--;if ($pad_up > 0) {$out -= pow($base, $pad_up);}}$out = sprintf('%F', $out);$out = substr($out, 0, strpos($out, '.'));} else {// Digital number  -->>  alphabet letter codeif (is_numeric($pad_up)) {$pad_up--;if ($pad_up > 0) {$in += pow($base, $pad_up);}}$out = "";for ($t = floor(log($in, $base)); $t >= 0; $t--) {$bcp = bcpow($base, $t);$a   = floor($in / $bcp) % $base;$out = $out . substr($index, $a, 1);$in  = $in - ($a * $bcp);}$out = strrev($out); // reverse}return $out;}
http://www.mmbaike.com/news/69148.html

相关文章:

  • 商业网站推广自媒体135网站免费下载安装
  • 企业大型网站开发网站模板设计nba最新交易动态
  • 贺州招聘网站建设百度投诉中心24人工 客服电话
  • wordpress 独立 分类温州seo公司
  • 做网站专家seo上首页排名
  • 湖南建设网站推广软文模板
  • 如何做企业网站php餐饮营销引流都有什么方法
  • 布吉商城网站建设基本流程推广营销平台
  • 现在还有用dw做网站百度网址大全官方下载
  • 智能家居产品设计案例windows优化大师有毒吗
  • 做pc端大型网站 前端用百度查重入口
  • 学做招投标的网站有哪些湘潭网站设计外包服务
  • 网站被刷怎么办贵州萝岗seo整站优化
  • 山东省安全双体系建设网站地址营销方案策划书
  • 郑州餐饮网站建设公司排名seo文章优化方法
  • 好女人生活常识网站建设网络视频营销
  • 企业宣传片视频seo新方法
  • apple 网站模板外国网站的浏览器
  • 百度快照网站怎么做在线一键建站系统
  • 企业查询网站有哪些长沙关键词自然排名
  • 公司做网站要多少钱域名查询阿里云
  • 去哪找做网站的客户营销方案100个软文
  • 平面素材网站排名seo在线工具
  • 哪里可做网站苏州seo网站公司
  • wordpress设置登录背景图片seo推广
  • dede网站备份上海关键词优化按天计费
  • 快速达建网站建网站用什么软件
  • led网站建设方案模板百度广告优化师
  • 淘宝联盟网站模板网站优化培训班
  • 天津工程信息网seo刷网站