MorphuisOGrady
Member
Hi there,
Has anyone ever had to generate random numbers for an application?
I can do this with an algorithim using the RTC as a seed but what I'm stumped on is a way to ensure each time I generate one its unique to the rest of the bunch. I'm not a statisically minded person so Its probably unlikely for a 6 digit number (100000-999999) to appear twice when I'll only ever require max 50 of these but none the less it could happen!
My thoughts are when I generate one I iterate through previously generated ones and ensure it dosent exist already. If it does generate again, but im sure theres a better way of doing things like this in the world of computing and authentication etc.
Any thoughts would be greatly welcomed.
Has anyone ever had to generate random numbers for an application?
I can do this with an algorithim using the RTC as a seed but what I'm stumped on is a way to ensure each time I generate one its unique to the rest of the bunch. I'm not a statisically minded person so Its probably unlikely for a 6 digit number (100000-999999) to appear twice when I'll only ever require max 50 of these but none the less it could happen!
My thoughts are when I generate one I iterate through previously generated ones and ensure it dosent exist already. If it does generate again, but im sure theres a better way of doing things like this in the world of computing and authentication etc.
Any thoughts would be greatly welcomed.