Module: Cipher::Generator
- Included in:
- Cipher
- Defined in:
- lib/cipher/generator.rb
Instance Method Summary collapse
Instance Method Details
#generate(unique) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/cipher/generator.rb', line 5 def generate(unique) output = '' i = 0 while i < (@key_length/@section_length).ceil do output << hash(unique + i.to_s)[0..@section_length-1] + @seperator i += 1 end output[0..-@seperator.length-1].upcase end |