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

Allow larger random seeds #1373

Merged
merged 1 commit into from
Jan 7, 2025
Merged

Allow larger random seeds #1373

merged 1 commit into from
Jan 7, 2025

Conversation

socram8888
Copy link
Contributor

@socram8888 socram8888 commented Dec 30, 2024

This patch allows specifying larger random seeds. Current value only allows for 10k possible variations, which is quite short considering these boards may contain millions of pictures.

The new value allows for 10^8 variations, so I am more likely to get a truly random image using the Danbooru/Ouroboros API with large data sets.

In order to keep autogenerated seeds short, the JS code that inserts the value will still produce only 4-digit sequences.

This should not cause any compatibility issues as MySQL uses a 32-bit field for the seed, which allows for log10(2**32) = ~9.6 digit seeds. The other engines fall back to the hash DRBG which accept arbitrary lengths.

@shish
Copy link
Owner

shish commented Jan 7, 2025

Looks good, thank you :)

@shish shish merged commit 78f269b into shish:main Jan 7, 2025
16 checks passed
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

Successfully merging this pull request may close these issues.

2 participants