Writing like this can generate the same combination. Is there any way to prevent this duplication
Writing like this can generate the same combination. Is there any way to prevent this duplication
As far as this code is concerned, it will definitely produce the same combination. If you can only combine a string among these numbers, it will be repeated sooner or later. If the generated string is to be stored in the database, you can first query the generated characters in the database and regenerate them if there are any. I don’t know the specific circumstances under which you use it. Anyway, there must be a solution. Why don’t you express your needs in detail so that others can give you some ideas.