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

Random Number Generator #166

Merged
merged 3 commits into from
Apr 19, 2024
Merged

Random Number Generator #166

merged 3 commits into from
Apr 19, 2024

Conversation

sylph01
Copy link
Contributor

@sylph01 sylph01 commented Apr 17, 2024

The RNG mrbgem implements generation of random numbers and strings. The main purpose of this is to generate random keys for cryptographic operations.

The API of the gem looks like the following:

  • RNG.random_int: generates a 32-bit random integer.
    • To limit the range of generated numbers, use the % operator to get the residual.
  • RNG.random_string(length): generates a string of length length with random bytes.

This gem currently has an implementation for RP2040 that uses RP2040's Ring Oscillator (-> https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf, Section 2.17).

- random_int returns a 32bit int
- Renamed functions
@hasumikin hasumikin merged commit 3102316 into picoruby:master Apr 19, 2024
1 check 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.

None yet

2 participants