Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class method

SecureRandom.alphanumeric

(?::Numeric?, ?chars: ::Array[::String]) -> ::String
alphanumeric(n = nil, chars: ALPHANUMERIC)

Compatibility methods for Ruby 3.2, we can remove this after dropping to support Ruby 3.2

See also .bytes also in 4.0 · 3.4