Skip to content
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

Possible Improvement #371

Open
thejasmeetsingh opened this issue Sep 16, 2023 · 3 comments
Open

Possible Improvement #371

thejasmeetsingh opened this issue Sep 16, 2023 · 3 comments

Comments

@thejasmeetsingh
Copy link

token = str(uuid4())

Hey there,
Can we add the current timestamp as well to the token string? UUID will give a unique value, but adding a timestamp can increase the probability that there will be fewer iterations and fewer chances that the program will encounter an infinite loop.

If you agree with the above observation, then please assign the issue to me!
Thanks😊

@WhyNotHugo
Copy link
Member

There exist 2^122 unique UUID4. Even on a database with billions of rows, the change of collision is negligible.

I think that the code in place is already an overkill; I doubt that this loop has ever had to try more than once.

@thejasmeetsingh
Copy link
Author

Yeah, that's true. I think it was initially put in as a fail-safe. But it can be optimized. Do you want me to work on this small thing?

@WhyNotHugo
Copy link
Member

No, it is unnecessary. Unless you process billions of payments per seconds during several centuries, it is unlikely that you'll ever have a collision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants