Module: UniqueNamesGenerator::Seed
- Defined in:
- lib/unique_names_generator/seed.rb
Overview
Generate a reproducible seed from a given string
Class Method Summary collapse
Class Method Details
.generate_seed(seed) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/unique_names_generator/seed.rb', line 7 def generate_seed(seed) return nil if seed.nil? transformed_string = transform_string(seed) seed_decimal = mulberry32(transformed_string) remove_decimal(seed_decimal) end |