how to shorten the url in a mathematical approach

后端 未结 4 463
闹比i
闹比i 2021-01-20 23:19

I am looking into the possibility of shortening / encrypting a url which will be from 150 to 250 characters in length to maximum 12 characters using an algorithm. Initially I a

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-21 00:00

    You did not mention if you are looking to only reduce the URL length or use the shortened URL for something (like tinyurl does). Is that your intent? If that is the case, then you can create the hash for the URL and use that hash internally to map to the actual URL. Then your choice of short length URLs depends on hashing algorithms. Based on your intent you can chose one of the options suggested in the replies.

提交回复
热议问题