Allow setting a seed for random numbers - #399
Open
MaartenS11 wants to merge 2 commits into
Open
Conversation
MaartenS11
force-pushed
the
feat/random-seeds
branch
from
August 4, 2026 13:23
ab8fd1a to
c73f366
Compare
MaartenS11
force-pushed
the
feat/random-seeds
branch
5 times, most recently
from
August 5, 2026 08:25
e02eaf8 to
0d9f738
Compare
…and Zephyr conflict Ideally we should not have to do this and it increases the size of the binary slightly but there is no way to avoid the conflict between ESP-IDF and Zephyr otherwise. However, rand and srand do work fine on other boards. Why rand/srand: The entropy API appears to be more useful for cryptographic purposes by using hardware entropy which we don't really need for basic random numbers. We still have some conf options for this but this is mostly becaues the networking stack can also sometimes use entropy. By using rand we can also use srand to set the seed which the entropy API does not support.
MaartenS11
force-pushed
the
feat/random-seeds
branch
from
August 5, 2026 08:28
0d9f738 to
f1eb89e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
random_set_seedto set the seed used byrandom_int.Currently we use
std::minstd_randon Zephyr, this due to a linker conflict between therandomfunctions defined by both Zephyr and ESP-IDF.