Module: SecureRandom

Defined in:
lib/securerandom/base32.rb

Class Method Summary collapse

Class Method Details

.base32(num_bytes = nil, variant_name = nil) ⇒ Object



7
8
9
# File 'lib/securerandom/base32.rb', line 7

def base32(num_bytes = nil, variant_name = nil)
  Base32.encode32(self.random_bytes(num_bytes), variant_name)
end

.base32_uuid(variant_name = nil) ⇒ Object

160 bits rather than 128, to ensure a constant number of pentets (32)



12
13
14
# File 'lib/securerandom/base32.rb', line 12

def base32_uuid(variant_name = nil)
  Base32.encode32(self.random_bytes(20), variant_name)
end