Sha256: 3bd955478c8fbc15311c9f8ffa3cb27e55a2906f32d09d170ecab772b15de2f4

Contents?: true

Size: 430 Bytes

Versions: 2

Compression:

Stored size: 430 Bytes

Contents

# frozen_string_literal: true
require 'securerandom'
require 'tokogen/version'
require 'tokogen/generator'

module Tokogen
  def self.token(length = 32)
    default_generator.generate(length)
  end

  def self.default_generator
    generator # calling explicitly without arguments
  end

  def self.generator(randomness_source: SecureRandom, **options)
    Generator.new(randomness_source: randomness_source, **options)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tokogen-0.1.2 lib/tokogen.rb
tokogen-0.1.1 lib/tokogen.rb