Class: Ccrypto::Ruby::SecureRandomEngine

Inherits:
Object
  • Object
show all
Defined in:
lib/ccrypto/ruby/engines/secure_random_engine.rb

Class Method Summary collapse

Class Method Details

.random_alphanum(size) ⇒ Object



23
24
25
# File 'lib/ccrypto/ruby/engines/secure_random_engine.rb', line 23

def self.random_alphanum(size)
  SecureRandom.alphanumeric(size)
end

.random_b64(size) ⇒ Object



15
16
17
# File 'lib/ccrypto/ruby/engines/secure_random_engine.rb', line 15

def self.random_b64(size)
  SecureRandom.base64(size)
end

.random_bytes(size) ⇒ Object



7
8
9
# File 'lib/ccrypto/ruby/engines/secure_random_engine.rb', line 7

def self.random_bytes(size)
  SecureRandom.random_bytes(size)
end

.random_hex(size) ⇒ Object



11
12
13
# File 'lib/ccrypto/ruby/engines/secure_random_engine.rb', line 11

def self.random_hex(size)
  SecureRandom.hex(size)
end

.random_number(val = nil) ⇒ Object



27
28
29
# File 'lib/ccrypto/ruby/engines/secure_random_engine.rb', line 27

def self.random_number(val = nil)
  SecureRandom.rand(val)
end

.random_uuidObject



19
20
21
# File 'lib/ccrypto/ruby/engines/secure_random_engine.rb', line 19

def self.random_uuid
  SecureRandom.uuid
end