Feature #18190
closedSplit `Random::Formatter` from securerandom
Description
Now Random::Formatter
methods are defined in securerandom.rb
, since it was split from SecureRandom
module historically.
However this module does not need to be SecureRandom
but just to respond to bytes
method.
I propose to move Random::Formatter
module to another file, random_formatter.rb
or random/formatter.rb
.
And keep only that file in ruby core and remove from securerandom library in future.
Updated by nobu (Nobuyoshi Nakada) about 3 years ago
- Related to Feature #18183: make SecureRandom.choose public added
Updated by matz (Yukihiro Matsumoto) about 3 years ago
Accepted.
Matz.
Updated by Eregon (Benoit Daloze) about 3 years ago
+1, I agree Random::Formatter should be defined in core, along Random which is already core.
Updated by nobu (Nobuyoshi Nakada) about 3 years ago
- Status changed from Open to Closed
Applied in changeset git|12a0a89e22fbc312e4a95a7749bc153532daa855.
[ruby/securerandom] Split Random::Formatter from SecureRandom [Feature #18190]
Updated by Eregon (Benoit Daloze) almost 2 years ago
To clarify, random/formatter is now a stdlib (not loaded by default).
Random::Formatter
is defined in core but has few methods before require 'random/formatter'
:
$ ruby -e 'puts Random::Formatter.instance_methods(false)'
rand
random_number
$ ruby -rrandom/formatter -e 'puts Random::Formatter.instance_methods(false)'
random_number
uuid
rand
alphanumeric
hex
random_bytes
base64
urlsafe_base64