Feature #4938

Add Random.bytes [patch]

Added by Marc-Andre Lafortune over 4 years ago. Updated 11 months ago.

Assignee:Yukihiro Matsumoto


It could be useful to add a Random.bytes method (equivalent to Random::DEFAULT.bytes), as per the simple patch attached.

randombytes.diff Magnifier (2.19 KB) Marc-Andre Lafortune, 06/28/2011 12:58 AM

randombytes-ruby22.diff Magnifier (2.38 KB) Hiroshi SHIBATA, 10/29/2014 05:37 AM


#1 Updated by Shyouhei Urabe over 3 years ago

  • Status changed from Open to Assigned

#2 Updated by Marc-Andre Lafortune almost 3 years ago

Comment about this trivial feature would be appreciated.

#3 Updated by Kenta Murata almost 3 years ago

  • Target version changed from 2.0.0 to next minor

I think it is useful and acceptable to introduce, but 2.0 is already frozen about its features, so the target version should be next-minor.

#4 Updated by Hiroshi SHIBATA 12 months ago

  • File randombytes-ruby22.diff added

I update this patch on Ruby 2.2.

#5 Updated by Marc-Andre Lafortune 12 months ago

Hi Nobu,
is there a reason not to commit this?

#6 Updated by Nobuyoshi Nakada 12 months ago

  • Assignee changed from Nobuyoshi Nakada to Eric Wong

I think there is no problems.

#7 Updated by Hiroshi SHIBATA 12 months ago

  • File deleted (randombytes-ruby22.diff)

#8 Updated by Hiroshi SHIBATA 12 months ago

I revised patch for Ruby 2.2.

#9 Updated by Eric Wong 12 months ago

shibata.hiroshi@gmail.com wrote:

File randombytes-ruby22.diff added

Looks good to me.
Any approval from matz since this is a new API?

#10 Updated by Eric Wong 11 months ago

  • Assignee changed from Eric Wong to Yukihiro Matsumoto

Any comment from matz for API addition?

Also available in: Atom PDF