Hi,
I have a code (written with help of chatgpt ) which is supposed to generate random 6-character string out of small letters and digits.
So there is 26 letters and 10 digits so in total 36 different characters. Length of 6 gives 36 ^ 6 = 2.176.782.336 possible combinations.
Somehow, with only a little over 2000 runs I got 31 repeat codes, 29 repeat twice and to repeat 3 times which is statistically almost impossible. I first thought it was just one which could be like 0,1% chance but not 30.
Any idea what is causing it? I run this in a loop of 10.000 twice and was not able to get repeat code. This is a part of a bigger tool which is run by different people and these repeats were created in a timespan of about 3 months, some repeat were 1, 2, 3 months apart and some weeks or days.
I will probably just write all codes to some txt and each time append it by new code and check if it exists to make sure it is for sure unique but this should not happen, I am interested in why this happened from technical side.
Any ideas?
Also - the code has a check if it isn't all digits if it is, then it changes last character to letter "q", it was just a temporary solution and will probably change that to just run again in that case. Digits appearing twice in the characters list are because there was over 2 times more letters so they were far more common so just wanted to make the codes have even number of letters and digits.
Thanks in advance for all answers
Bookmarks