title: Generate unique serial numbers for mass produced products
body: <p>I need help with understanding how to tackle this problem of generating Unique Serial Numbers or UIDs for mass produced products.</p>
  
  <p>I will be producing products in mass, as of now I think that I will be making >50000 units. When these units are manufactured and ready I must test them before dispatching and at which point in time I would also like to give each one of them a Unique ID.</p>
  
  <p>I was thinking of writing an application to generate a <em>128 bit unique number generator application</em> and ask the testers to run it on their jigs, generate an ID, assign the ID and then carry out testing.</p>
  
  <p>But my question is, please look at the illustration below, if my same application is running on say 3 (or more) different jigs <strong>in parallel at the same time</strong>, how do I make sure that the numbers generated by these systems are <strong>never ever</strong> equal to one another?</p>
  
  <p>How do I programmatically make sure that <strong>Unique Serial #1 != Unique Serial #2 != Unique Serial #3</strong>?</p>
  
  <p>If they are ever equal by any chance I will land in great trouble tracking them, once they are out.</p>
  
  <p>There are some hardware approaches, such as making use of UID chips/EEPROMs from Atmel or Maxim, but they will add cost. I wish to solve this at software level and keep the hardware approach as a last resort.</p>
  
  <p>I have found out that the test jigs are capable of running <strong>C#</strong> or <strong>Python</strong> applications.</p>
  
  <p>Please help!</p>
  
  <p><img src="https://i.stack.imgur.com/R0hrl.png" alt="Illustration of Unique Serial # Generator application running on three different test jigs."></p>