-
-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Increase Short URL key entropy to decrease likelihood of key collisions #291
base: master
Are you sure you want to change the base?
Conversation
Hey @stevebauman! Sorry for not checking this one out yet. Last week was crazy busy! But I'm hoping to check it out this week 😄 |
Hey man no worries at all! In no rush as I was already able to make this change in production (appreciate you making this customizable!), take your time 🙏 |
Hey @stevebauman! I've been looking at this and I can't make my mind up on something, so I'm hoping you'll be able to advise me. Do you think this would be better as the default generator? Or do you think this should be added as a separate generator class (that someone could then just set via the config)? I feel like the existing generator logic has worked pretty well for a large majority of applications for the past few years. So I don't know if it should be left as the default. Or, maybe your new logic should become the default if it's not going to affect any existing apps? In my mind, if a dev using the package doesn't notice any difference in the keys being generated, that's perfect for me! I'm just scared of disrupting any existing apps haha 😄 |
Hey @ash-jc-allen ! Totally understandable. I think adding it as a separate generator as you mentioned may be the better choice to avoid any possible disruption to existing production applications. Maybe we should add a note to the readme to possibly enable this generator in situations of creating short URLs in queued jobs to prevent the likelihood of collisions? |
This is related to PR #290, but is a slimmer approach to decreasing the likelihood of collisions. This means that two or more queued jobs attempting to create Short URL's at the same time will have to execute at the same microsecond to generate the same short URL key (very unlikely).