Skip to content

Conversation

@makiuchi-d
Copy link
Contributor

This PR proposes using the existing rand_hwrng.go implementation of hardwareRand() for RP2040/RP2350.

On these targets, hardwareRand() calls machine.GetRNG() on every invocation, so the math/rand global RNG always obtains randomness and does not fall back to fastrand64().

This makes hardwareRand() behave as its name suggests, at the cost of lower performance.

@deadprogram
Copy link
Member

Thanks for the improvement here @makiuchi-d and to @eliasnaur for all the help with this set of features.

Now squash/merging.

@deadprogram deadprogram merged commit f7fd5cf into tinygo-org:dev Dec 18, 2025
19 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.

3 participants