Which expert can give an example of base62 decoding?

Source: Internet
Author: User
Who can give an example of base62 decoding ?? I can see an example about URL encoding on the Internet, but there is no decoding example. who can give it a decoding example ?? Example code for encoding: & lt ;? Phpfunction & nbsp; base62 ($ x) {$ show & nbsp ;=& nbsp; ''; who can give an example of base62 decoding with wh ??
I can see an example about URL encoding on the Internet, but there is no decoding example. who can give it a decoding example ??

Example code for encoding:
 function base62($x){
$show = '';
while($x > 0){
$s = $x % 62;
if ($s > 35) {
$s = chr($s+61);
} elseif ($s > 9 && $s<=35) {
$s = chr($s + 55);
}
$show .= $s;
$x = floor($x/62);
}
return $show;
}
function urlShort($url)
{
$url = crc32($url);
$result = sprintf("%u", $url);
return base62($result);
}
echo urlShort("http://www.baidu.com");
?>
Php url function
------ Solution --------------------
This is impossible!
Your urlShort function only takes the checksum (CRC32) of the incoming data, so it is irreversible.

------ Solution --------------------
301 jump
------ Solution --------------------
Reference:
Reference: this is impossible!
Your urlShort function only takes the checksum (CRC32) of the incoming data, so it is irreversible.

In the past, how are short URLs implemented?

Convert a domain name into a short domain name using a certain algorithm before receiving the database
Get the original domain name based on the short domain name query form and then jump

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.