Jump to content

Order Number Generation


Guest RichardsonDA

Recommended Posts

Guest RichardsonDA

I was wondering how the order number is generated; it appears like the last 4 digits are random.

050925-005343-1476

05 = Year

09 = Month

25 = Day

00 = Hours

53 = Minutes

43 = Seconds

1476 = ??????

Any ideas?

I have many that dont end in a sequence

5421

1900

7359

9271

1476

I dont see a patten :rolleyes:

Thanks

Dave

Link to comment
Share on other sites

Guest EverythingWeb

The last 4 digits are random, you are correct.

It would be very VERY unlucky and highly highly unlikely that at the very same second, of the very same minute, of the very same hour... (you get the picture - the exact same time) that the random number generates 4 random numbers the same as a another.

I wonder what the chances are...........

Link to comment
Share on other sites

Well, I believe that the rand function in PHP 4.3.0 and above is self-seeded based on CPU clock ticks (extremely high number per second) and is re-seeded on each call of rand, so it would be functionally impossible. Two requests could not stream through the CPU on the same tick so therefore could not get the same random number.

Just food for thought. :rolleyes:

Why do I know? I just did some studying of the rand / mtrand / srand / smtrand functions in PHP to get my random sort order mod working properly. :w00t:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...