From: naruse@... Date: 2020-11-26T05:30:43+00:00 Subject: [ruby-core:101080] [Ruby master Misc#17319] Rename Random.urandom to os_random and document random data sources Issue #17319 has been updated by naruse (Yui NARUSE). Status changed from Open to Rejected As https://bugs.ruby-lang.org/issues/9569#note-58 says, the name `urandom` insists it doesn't block. Ruby often provide Unix emulation layer on Windows. I don't think this needs special treatment for Random.urandom. Also you can easily suspect Random.urandom uses `/dev/urandom` and Win32 in this context about secure_random.rb. ---------------------------------------- Misc #17319: Rename Random.urandom to os_random and document random data sources https://bugs.ruby-lang.org/issues/17319#change-88757 * Author: zofrex (James Sanderson) * Status: Rejected * Priority: Normal ---------------------------------------- SecureRandom gets randomness from `Random.urandom`, which is a confusing name because `urandom` only uses /dev/urandom in some circumstances. On reading the `secure_random.rb` code this morning I got very confused how it was supporting "win32" for example, because it appears to only use openssl and /dev/urandom. I have renamed `urandom` to `os_random`. With this change, it is much more obvious from reading `secure_random.rb` what is happening, in my opinion. I have also added `urandom` as an alias to `os_random` so this is not a breaking change. I am not 100% sure I documented this alias correctly. I have also updated the documentation for `os_random` (was `urandom`), `SecureRandom`, and `random_raw_seed` to reflect that there are multiple potential sources for random data, not just urandom, openssl, and win32. -- https://bugs.ruby-lang.org/ Unsubscribe: