-
Notifications
You must be signed in to change notification settings - Fork 233
Rng
API
#38
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
Labels
Comments
Closed
I'm implementing this for STM32L4(32): https://github.com/nickray/stm32l4-hal/blob/rng/src/rng.rs
|
This trait was added. There is discussion about replacing/complementing this with |
Hah! I knew there were previous discussions about this. Let's close this then. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'd like to suggest to suggest a new
Rng
API for a common way of getting random numbers from devices with some source of randomness.I've already implemented this as a proof-of-concept in my
nrf51-hal
crate (https://github.com/therealprof/nrf51-hal) and an example use in mymicrobit
crate (https://github.com/therealprof/microbit).The suggested (blocking) API is similar to the
I2c
API in that a mutable u8 slice is passed as parameter which will be filled with the random data and a Result is returned:Potentially this could also use an implementation for other (or even variable) array types, e.g. the
rand
crate requires a u32 slice as a seed.I'd be happy to supply a PR for the the implementation.
The text was updated successfully, but these errors were encountered: