[#109095] [Ruby master Misc#18888] Migrate ruby-lang.org mail services to Google Domains and Google Workspace — "shugo (Shugo Maeda)" <noreply@...>
Issue #18888 has been reported by shugo (Shugo Maeda).
16 messages
2022/06/30
[ruby-core:108888] [Ruby master Feature#18183] make SecureRandom.choose public
From:
"austin (Austin Ziegler)" <noreply@...>
Date:
2022-06-14 03:25:20 UTC
List:
ruby-core #108888
Issue #18183 has been updated by austin (Austin Ziegler).
mame (Yusuke Endoh) wrote in #note-13:
> austin (Austin Ziegler) wrote in #note-11:
> > One option would be to extend `Random::Formatter#alphanumeric` to have an optional "alphabet":
>
> This approach looks nice to me. If "numeric" sounds a bit weird here, how about introducing `Random::Formatter#alphabet(n = 16, alphabet: [*'A'..'Z', *'a'..'z'])`?
I think that `#alphanumeric` might still be the better name as the alphabet could be `[*'ABCDFGHKMNPQRTUVWXYZ'.split(''), *'0'..'9']`. If that’s not preferred, there are two choices, I think:
- `Random::Formatter#alphanumeric(n = 16, set: …)`
- `Random::Formatter#from_set(set, n = 16)` (or `Random::Formatter#from_set(n = 16, set: …)`)
I think that `alphabet` is still the right word here, as it’s sort of the "term of art" for this sort of thing, although `set` is probably a good name as well. In any case, there should be a recommendation that the `alphabet` or the `set` parameter for any of these be a constant frozen value and not a localized constructed value.
----------------------------------------
Feature #18183: make SecureRandom.choose public
https://bugs.ruby-lang.org/issues/18183#change-97966
* Author: olleicua (Antha Auciello)
* Status: Rejected
* Priority: Normal
----------------------------------------
This issue https://bugs.ruby-lang.org/issues/10849
added `SecureRandom.alphanumeric` and also the private method choose.
`choose` was kept private because the method name wasn't the best name to represent the behavior.
I think if it was called `random_string` it would be very clear what it does.
I also think it should be aliased to choose as well to allow backwards compatibility for people bypassing the private method with `send` (e.g. https://www.thetopsites.net/article/58611103.shtml)
I'm planning to put together a pull request for this. Please let me know if there are any complications I'm not considering.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>