module Pebbles::RandomKeyGenerator

Constants

VERSION

Public Class Methods

generate(length) click to toggle source
# File lib/pebbles/random_key_generator.rb, line 6
def self.generate(length)
  length = length.to_i if length.instance_of?(String)
  [OpenSSL::Random.random_bytes(length)].pack('m').gsub(/\W/, '')[0, length]
end