An algorithm for generating non-repetitive random strings which satisfies the condition

requires the number of generators to meet / ^ [Amurz] {2} d {3} $/
each generation is not repeated
for example, 1000 are generated, 1000 are not repeated
there is no need to remove duplicates such as arrays, it seems that the algorithm can directly guarantee the weight
ask for help

Mar.07,2021

you can generate several in sequence, and then just take one at random


think of the number to be generated as a 36-digit (26-letter + 10-digit) five-digit number that meets the following conditions:

-the range is AA000-ZZ999
-the last three digits are numbers (excluding the last three letters in the above interval)

then number the numbers starting at 0 in order. For example, AA000 is 0, AA001 is 1, and so on, suppose there are a total of m digits. Next, find out the corresponding relationship between the number N and the number n.

Finally, several non-repeating integers between 0murm are generated as needed (this is easy) and converted to 5-bit 36-digit numbers according to the corresponding relationship.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37b4c-2c0cb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37b4c-2c0cb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?