سؤال

I am using one of these to create a serial key. I would like to know md5(uniqid()) or md5(mktime()) better to be use?

Which one has a less change to get a duplicated key?

هل كانت مفيدة؟

المحلول

md5(uniqid("", true)) is the better method. time() and mktime() are accurate to one second, so two executions within the same clock second would produce duplicate keys.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top