I want to generate a 16-digit hexadecimal serial number, for example: F204-8BE2-17A2-CFF3.
(This template gives me 16 ^ 16 different serial numbers, but I don’t need all of them)
I need you to offer me an algorithm for generating these serial numbers randomly with a special characteristic that:
every two serial numbers have (at least) 6 different digits
(= This means that if you are given two of the most similar serial numbers, they should still have a difference of 6 indexes)
I know that a good algorithm with this characteristic should remember the previously generated serial numbers, and I do not want this.
In fact, I need an algorithm that does this with the least chance of collision of the selected pair (less than 0.001)
PS:
I just tried to create a 10K line randomly using an MD5 hash and gave a similar line (like = more than three identical digits) with a probability of 0.00018.
source
share