Sha256: 96ed2a0313679335d8755ed4125addd072aadda7aa4cc2ea3ee131eae839739c

Contents?: true

Size: 1.3 KB

Versions: 63

Compression:

Stored size: 1.3 KB

Contents

# <!-- rdoc-file=lib/securerandom.rb -->
# ## Secure random number generator interface.
#
# This library is an interface to secure random number generators which are
# suitable for generating session keys in HTTP cookies, etc.
#
# You can use this library in your application by requiring it:
#
#     require 'securerandom'
#
# It supports the following secure random number generators:
#
# *   openssl
# *   /dev/urandom
# *   Win32
#
#
# SecureRandom is extended by the Random::Formatter module which defines the
# following methods:
#
# *   alphanumeric
# *   base64
# *   choose
# *   gen_random
# *   hex
# *   rand
# *   random_bytes
# *   random_number
# *   urlsafe_base64
# *   uuid
#
#
# These methods are usable as class methods of SecureRandom such as
# `SecureRandom.hex`.
#
# If a secure random number generator is not available, `NotImplementedError` is
# raised.
#
module SecureRandom
  extend Random::Formatter

  def self.alphanumeric: (?Integer?) -> String

  def self.base64: (?Integer?) -> String

  def self.hex: (?Integer?) -> String

  def self.random_bytes: (?Integer?) -> String

  def self.random_number: () -> Float
                        | (Integer) -> Integer
                        | (Numeric) -> Numeric

  def self.urlsafe_base64: (?Integer?, ?bool?) -> String

  def self.uuid: () -> String
end

Version data entries

63 entries across 63 versions & 2 rubygems

Version Path
rbs-3.7.0.dev.1 stdlib/securerandom/0/securerandom.rbs
rbs-3.6.1 stdlib/securerandom/0/securerandom.rbs
rbs-3.6.0 stdlib/securerandom/0/securerandom.rbs
rbs-3.6.0.pre.3 stdlib/securerandom/0/securerandom.rbs
rbs-3.6.0.pre.2 stdlib/securerandom/0/securerandom.rbs
rbs-3.6.0.pre.1 stdlib/securerandom/0/securerandom.rbs
rbs-3.6.0.dev.1 stdlib/securerandom/0/securerandom.rbs
rbs-3.5.3 stdlib/securerandom/0/securerandom.rbs
rbs-3.5.2 stdlib/securerandom/0/securerandom.rbs
rbs-3.5.1 stdlib/securerandom/0/securerandom.rbs
rbs-3.5.1.pre.1 stdlib/securerandom/0/securerandom.rbs
rbs-3.5.0 stdlib/securerandom/0/securerandom.rbs
rbs-3.5.0.pre.2 stdlib/securerandom/0/securerandom.rbs
rbs-3.5.0.pre.1 stdlib/securerandom/0/securerandom.rbs
rbs-3.4.4 stdlib/securerandom/0/securerandom.rbs
rbs-3.4.3 stdlib/securerandom/0/securerandom.rbs
rbs-3.4.2 stdlib/securerandom/0/securerandom.rbs
getargv-0.3.3-universal-darwin vendor/bundle/ruby/3.3.0/gems/rbs-2.8.4/stdlib/securerandom/0/securerandom.rbs
rbs-3.4.1 stdlib/securerandom/0/securerandom.rbs
rbs-3.4.0 stdlib/securerandom/0/securerandom.rbs