<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/lib/securerandom.rb, branch v3_2_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>lib/securerandom.rb: Fix the check of availability of Random.urandom</title>
<updated>2022-02-16T07:32:28+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2022-02-16T05:15:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b9851c7e1b1cbc13b050831b0429e7a4097e11b7'/>
<id>b9851c7e1b1cbc13b050831b0429e7a4097e11b7</id>
<content type='text'>
Random.urandom raises a RuntimeError if it is unavailable.
[Bug #13885]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Random.urandom raises a RuntimeError if it is unavailable.
[Bug #13885]
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/securerandom] Split Random::Formatter from SecureRandom [Feature #18190]</title>
<updated>2021-12-09T11:26:44+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-12-05T12:53:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=12a0a89e22fbc312e4a95a7749bc153532daa855'/>
<id>12a0a89e22fbc312e4a95a7749bc153532daa855</id>
<content type='text'>
https://github.com/ruby/securerandom/commit/1e57277b9e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/securerandom/commit/1e57277b9e
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/securerandom] [DOC] fix a code mark up [ci skip]</title>
<updated>2021-08-24T10:29:54+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-08-24T10:24:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b62ed309f05d248c746279f35f2609f01ea1e4a5'/>
<id>b62ed309f05d248c746279f35f2609f01ea1e4a5</id>
<content type='text'>
https://github.com/ruby/securerandom/commit/de47532707
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/securerandom/commit/de47532707
</pre>
</div>
</content>
</entry>
<entry>
<title>Make SecureRandom support Ractor</title>
<updated>2020-09-09T19:45:43+00:00</updated>
<author>
<name>Aaron Patterson</name>
<email>tenderlove@ruby-lang.org</email>
</author>
<published>2020-09-05T00:32:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=475c8701d74ebebefb2f53052cde1a5effb4cb81'/>
<id>475c8701d74ebebefb2f53052cde1a5effb4cb81</id>
<content type='text'>
SecureRandom lazily defines `get_random`.  Accessing the mutex to define
the `get_random` method is not supported inside a Ractor.  This commit
defines `gen_random` when `securerandom` is required and makes it
suppore Ractor (as well as thread safe).

Here is a test program:

```ruby
require "securerandom"

r = Ractor.new do
  loop do
    Ractor.yield SecureRandom.hex
  end
end

p r.take
```

Before this commit:

```
$ make runruby
./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems ./test.rb
&lt;internal:ractor&gt;:38: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
/Users/aaron/git/ruby/lib/securerandom.rb:94:in `gen_random': can not access instance variables of classes/modules from non-main Ractors (RuntimeError)
&lt;internal:ractor&gt;:124:in `take': thrown by remote Ractor. (Ractor::RemoteError)
	from ./test.rb:9:in `&lt;main&gt;'
/Users/aaron/git/ruby/lib/securerandom.rb:94:in `gen_random': can not access instance variables of classes/modules from non-main Ractors (RuntimeError)
	from /Users/aaron/git/ruby/lib/securerandom.rb:155:in `random_bytes'
	from /Users/aaron/git/ruby/lib/securerandom.rb:176:in `hex'
	from ./test.rb:5:in `block (2 levels) in &lt;main&gt;'
	from ./test.rb:4:in `loop'
	from ./test.rb:4:in `block in &lt;main&gt;'
make: *** [runruby] Error
```

After this commit:

```
$ make runruby
./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems ./test.rb
&lt;internal:ractor&gt;:38: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
"3fc8885157e3911bab4b5d7619bb0308"
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
SecureRandom lazily defines `get_random`.  Accessing the mutex to define
the `get_random` method is not supported inside a Ractor.  This commit
defines `gen_random` when `securerandom` is required and makes it
suppore Ractor (as well as thread safe).

Here is a test program:

```ruby
require "securerandom"

r = Ractor.new do
  loop do
    Ractor.yield SecureRandom.hex
  end
end

p r.take
```

Before this commit:

```
$ make runruby
./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems ./test.rb
&lt;internal:ractor&gt;:38: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
/Users/aaron/git/ruby/lib/securerandom.rb:94:in `gen_random': can not access instance variables of classes/modules from non-main Ractors (RuntimeError)
&lt;internal:ractor&gt;:124:in `take': thrown by remote Ractor. (Ractor::RemoteError)
	from ./test.rb:9:in `&lt;main&gt;'
/Users/aaron/git/ruby/lib/securerandom.rb:94:in `gen_random': can not access instance variables of classes/modules from non-main Ractors (RuntimeError)
	from /Users/aaron/git/ruby/lib/securerandom.rb:155:in `random_bytes'
	from /Users/aaron/git/ruby/lib/securerandom.rb:176:in `hex'
	from ./test.rb:5:in `block (2 levels) in &lt;main&gt;'
	from ./test.rb:4:in `loop'
	from ./test.rb:4:in `block in &lt;main&gt;'
make: *** [runruby] Error
```

After this commit:

```
$ make runruby
./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems ./test.rb
&lt;internal:ractor&gt;:38: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
"3fc8885157e3911bab4b5d7619bb0308"
```
</pre>
</div>
</content>
</entry>
<entry>
<title>fix visibility of SecureRandom.gen_random</title>
<updated>2019-05-14T02:44:20+00:00</updated>
<author>
<name>Urabe, Shyouhei</name>
<email>shyouhei@ruby-lang.org</email>
</author>
<published>2019-05-14T02:44:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5bab1304af25a843728dbcd2f3594913740aecb0'/>
<id>5bab1304af25a843728dbcd2f3594913740aecb0</id>
<content type='text'>
Aliasing a method preserves its visibility.  These aliases turn
formerly-public methods into private.  Should make them public
again.  [Bug #15847]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Aliasing a method preserves its visibility.  These aliases turn
formerly-public methods into private.  Should make them public
again.  [Bug #15847]
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/securerandom.rb: [DOC] small grammar fixes</title>
<updated>2019-01-20T15:06:11+00:00</updated>
<author>
<name>stomar</name>
<email>stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2019-01-20T15:06:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f284eb3d54df6d1bb754986f9f5272136ff73466'/>
<id>f284eb3d54df6d1bb754986f9f5272136ff73466</id>
<content type='text'>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>[DOC] SecureRandom is extended by Random::Formatter.</title>
<updated>2018-12-27T12:42:45+00:00</updated>
<author>
<name>akr</name>
<email>akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-12-27T12:42:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b7c2ca7a3225efcc79a72ee3798abc3320f5c304'/>
<id>b7c2ca7a3225efcc79a72ee3798abc3320f5c304</id>
<content type='text'>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/securerandom.rb: improve docs</title>
<updated>2018-06-12T20:22:43+00:00</updated>
<author>
<name>stomar</name>
<email>stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-06-12T20:22:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=88aaf889231ef1f780ccac49fbf656602264f268'/>
<id>88aaf889231ef1f780ccac49fbf656602264f268</id>
<content type='text'>
* lib/securerandom.rb: [DOC] add alphanumeric example to module docs.
  [Fix GH-1812]

From: Justin Bull &lt;me@justinbull.ca&gt;

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* lib/securerandom.rb: [DOC] add alphanumeric example to module docs.
  [Fix GH-1812]

From: Justin Bull &lt;me@justinbull.ca&gt;

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/securerandom.rb: improve docs</title>
<updated>2018-05-11T20:07:32+00:00</updated>
<author>
<name>stomar</name>
<email>stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-05-11T20:07:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4b8d33a32345ff16af0df3f14ec439285a3ac6de'/>
<id>4b8d33a32345ff16af0df3f14ec439285a3ac6de</id>
<content type='text'>
* lib/securerandom.rb: [DOC] drop unnecessary `p' from code examples.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* lib/securerandom.rb: [DOC] drop unnecessary `p' from code examples.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>securerandom.rb: [DOC] require in examples</title>
<updated>2018-05-05T03:12:20+00:00</updated>
<author>
<name>nobu</name>
<email>nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-05-05T03:12:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d32763eca0817c92ee0451ee6e08576879317e22'/>
<id>d32763eca0817c92ee0451ee6e08576879317e22</id>
<content type='text'>
* lib/securerandom.rb: added `require 'securerandom'` to each
  example, to state these methods are defined in this library and
  require it explicitly.  [ruby-core:85933] [Bug #14576]

[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* lib/securerandom.rb: added `require 'securerandom'` to each
  example, to state these methods are defined in this library and
  require it explicitly.  [ruby-core:85933] [Bug #14576]

[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
</feed>
