Testing in this http://nh.gs/
I generate URLs consecutively to get
Http://nh.gs/4hm
Http://nh.gs/con
After base62
4HM = 16452
con = 47639
The traditional is to generate 5 to 6 bits, this should be self-increasing, but why the continuous generation of the base62 after the value is so much worse, supposedly continuous, I think it should be used some way to prevent the recurrence of duplication, this is the short URL source of the download address Http://pan.baidu.com/s/1pJ4zLDD
I analyzed the source code but could not find the core of the build, Baidu Google also looked for, so to ask the great God to help (⊙0⊙)
Reply content:
Testing in this http://nh.gs/
I generate URLs consecutively to get
Http://nh.gs/4hm
Http://nh.gs/con
After base62
4HM = 16452
con = 47639
The traditional is to generate 5 to 6 bits, this should be self-increasing, but why the continuous generation of the base62 after the value is so much worse, supposedly continuous, I think it should be used some way to prevent the recurrence of duplication, this is the short URL source of the download address Http://pan.baidu.com/s/1pJ4zLDD
I analyzed the source code but could not find the core of the build, Baidu Google also looked for, so to ask the great God to help (⊙0⊙)
Uploads/Web/Lib/Action/IndexAction.class.php
Line No. 268.
$data['tinyurl'] = getfreetiny($model->field('tinyurl')->select());
getfreetiny
Defined in the Uploads/Web/Common/common.php
33rd row.
getfreetiny
The function calls it above (line 22nd) get_tinyurl
to convert to the getfreetiny
corresponding string according to the random number generated in the.
So the conclusion is that the number is randomly generated. That's why you can see the difference between the results.
Probably looked at the source code, found a few sentences in the ApiAction.class.php
php
public function thirdapi() { $method = trim($_GET['api']); $url = trim($_POST['url']); $url = empty($url) ? 'http://www.baidu.com': $url; if($method=='dwz') { $baseurl = "http://dwz.cn/create.php"; $data=array('url'=>$url); }
So it is estimated that the dwz.cn API is called to generate the algorithm that is not implemented by itself.
Re-duplicate Bibai
First, the probability of repeating is very small.
And then you can regenerate it even if it's a duplicate.
Just the sauce purple.
do { 生成隨機數} while (重複)