What's the best way to create a short hash, similar to what tiny Url does?

前端 未结 13 1318
被撕碎了的回忆
被撕碎了的回忆 2020-12-04 09:10

I\'m currently using MD5 hashes but I would like to find something that will create a shorter hash that uses just [a-z][A-Z][0-9]. It only needs to be around 5-

13条回答
  •  鱼传尺愫
    2020-12-04 09:55

    You can use CRC32, it is 8 bytes long and similar to MD5. Unique values will be supported by adding timestamp to actual value.

    So its will look like http://foo.bar/abcdefg12.

提交回复
热议问题