开发者

What would be an efficient way of generating Plancast-style short URLs?

Plancast generate short URLs like http://plancast.com/p/3e9c for event pages.

URL hashes don't seem sequential, but they're probably not completely random either.

Here are a few ones for example: 3sro, 3fsz, 3k4f, 382n, 3c5x, etc.

What would be an efficient way of deterministically generating such hashes from PHP and MySQL, with the appearance of being randomly ge开发者_运维问答nerated?


We set up those URLs so that last piece is simply the ID of the event in our database converted to base 36. They only appear random because they are in that base, but in fact, they are incrementing one at a time as we get new events in the system.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜