整数生成唯一字符串的加密PHP库

2018-01-23 16:43:184153251查看评论(13)
简介:

<?php
namespace Hashids;
class Hashids implements HashidsInterface
{
    const SEP_DIV = 3.5;
    const GUARD_DIV = 12;
    protected $alphabet;
    protected $seps = 'cfhistuCFHISTU';
    protected $guards;
    protected $minHashLength;
    protected $salt;
    public function __construct($salt = '', $minHashLength = 0, $alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890')
    {
        $this->salt = $salt;
        $this->minHashLength = $minHashLength;
        $this->alphabet = implode('', array_unique(str_split($alphabet)));
        if (strlen($this->alphabet) < 16) {
            throw new HashidsException('Alphabet must contain at least 16 unique characters.');
        }
        if (strpos($this->alphabet, ' ') !== false) {
            throw new HashidsException('Alphabet can\'t contain spaces.');
        }

这是一个功能强大的php加密类,构造参数是密匙,对数字进行一些加密和解密的操作。

整数生成唯一字符串的加密PHP库

申明:本站所有资源都是转载各大下载站,或由网友投稿发布,请自行检测软件的完整性,如有侵权请联系我们删除下架,联系方式:admin@php.cn

相关推荐

整数生成唯一字符串的加密PHP库

整数生成唯一字符串的加密PHP库
3962247

hashids.php-master整数生成唯一字符串的加密库

hashids.php-master整数生成唯一字符串的加密库
93441

把整数生成唯一字符串的PHP库

把整数生成唯一字符串的PHP库
98231

RandomLib-master生成随机数和随机字符串的PHP库

RandomLib-master生成随机数和随机字符串的PHP库
55531

Requests-masterHTTP的PHP库

Requests-masterHTTP的PHP库
76935

php生成excel文件到指定目录的函数类

php生成excel文件到指定目录的函数类
5287210

数组排序类库

数组排序类库
1078176

validation-Laravel的验证库

validation-Laravel的验证库
134577
网页评论
最新评论
So what? Alvin
孤
  • 6666666666666看看
  • 2019-05-23 17:44:16发表+0回复
Belief&&Balance
Madson麦
DK
  • DK
  • 非经济复苏的
  • 2019-05-10 10:23:14发表+0回复
心与境合
艾
  • 6666666666666啊啊
  • 2019-04-12 14:18:26发表+0回复
保哥后院
Flgs
  • Flgs
  • 6666666666666看看
  • 2019-04-04 22:41:52发表+0回复
时间流杀
Fulin
  • Fulin
  • 感谢好东西分享
  • 2019-03-10 10:09:39发表+0回复
Jason
  • Jason
  • 学习学习,谢谢了
  • 2019-02-18 11:38:48发表+0回复
MT
  • MT
  • 6666666666666看看
  • 2019-02-13 14:03:42发表+0回复