Ruby on Rails - generating bit.ly style uuids

后端 未结 4 748
再見小時候
再見小時候 2021-02-10 12:40

I\'m trying to generate UUIDs with the same style as bit.ly urls like:

http://bit.ly/aUekJP

or cloudapp ones:

http://cl.ly/1hVU         


        
4条回答
  •  梦谈多话
    2021-02-10 13:19

    The only way to guarantee uniqueness is to keep a global count and increment it for each use: 0000, 0001, etc.

提交回复
热议问题