I want a javascript code that will generate all of the possible combinations of strings with requirements (For example string min and max length, what characters can be used, etc.)
And for every combination, i want it to run this code:
Yea, a concept of programming is that you just need something that’s the best you just need something that’s good enough for your use case. Yes they might generate duplicates but the chance is really low, the same goes for similar things like uuids and youtube video ids (although youtube will most likely try to repeat the random process if a duplicate is detected). Another thing you can look into are snowflakes (twitter docs) or discord docs which will even be less likely to collide especially if your app is less popular because it uses time since a epoch as part of the number. However use them carefully as sometimes they can go above the amount of safe integers and change unexpectdly. To workaround this issue I suggest bigints or just strings