Demand
$str = ' topics/new?forum_id=php ';
echo Shorturl ($STR)//output: js4d8x5d
echo unshorturl (' js4d8x5d ')//restore string output: topics/new?forum_id=php
Finding Shorturl and Unshorturl functions
Reply to discussion (solution)
No coding rules, how to write a program?
Short link?
hash function + Hash collision solution
Sina's short URL seems to be the corresponding relationship between the URL and ID number stored in the server. Not studied.
Short link?
hash function + Hash collision solution
Sina's short URL seems to be the corresponding relationship between the URL and ID number stored in the server. Not studied.
En short connection, corresponding storage too much trouble ~ Too many hash this type of PHP system functions a lot, but is one-way. My ideal is the CRC32 function 8-bit result, but CRC32 can not be reversed
No coding rules, how to write a program?
That's the question.
Constrained space is limited only by calculation.
Assuming that the original string does not contain Chinese, it can be represented by 96 binary 0000000-1011111
But it only tightens 1/8.
So the short URLs are all based on the table, providing only the table item index
Constrained space is limited only by calculation.
Assuming that the original string does not contain Chinese, it can be represented by 96 binary 0000000-1011111
But it only tightens 1/8.
So the short URLs are all based on the table, providing only the table item index
Oh, want to learn the URL of this website http://hangzhou.8684.cn/z_d7bc763d