Unique key generation

后端 未结 13 2235
一个人的身影
一个人的身影 2020-12-03 05:53

I looking for a way, specifically in PHP that I will be guaranteed to always get a unique key.

I have done the following:

strtolower(substr(crypt(tim         


        
13条回答
  •  甜味超标
    2020-12-03 06:13

    Without writing the code, my logic would be:

    Generate a random string from whatever acceptable characters you like.
    Then add half the date stamp (partial seconds and all) to the front and the other half to the end (or somewhere in the middle if you prefer).

    Stay JOLLY!
    H

提交回复
热议问题