mercredi 6 mai 2020

Laravel 6+ Uniq id generation Only in no with Additional Logic

I am generating A uniqid with time() function Thats is about 10 digits.. i want a uniq no where i can store 18 digits no only! For these i want to generate rand(3 digit) + rand(3 digits) + rand(2 digits) .. I have Few questions 1. Is there a chance to collision 2. Is the 10 digits time() can increase into 11 or 12 3. If it increases Than i want to build a logic where i can dynamically generate the random no Like => 18(Max) - if 10 (time) => then 3+3+2 if(11) then 3+2+2 && if(12) then 3+3 If it is possible then Please Guide me! Other Suggetions Also welcome!




Aucun commentaire:

Enregistrer un commentaire