mnemonic_words 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/mnemonic_words.rb +1 -1
  2. metadata +1 -1
@@ -39,7 +39,7 @@ class MnemonicWords
39
39
  end
40
40
 
41
41
  def decode(s)
42
- indices = s.downcase.split(/\s+/).map { |word| @word_list.index(word) }
42
+ indices = s.downcase.split(/\s+/).reject(&:empty?).map { |word| @word_list.index(word) }
43
43
  return nil if indices.any? &:nil?
44
44
  y = indices.inject(0) { |memo,x| memo * @base + x }
45
45
  result = ((y * @divisor) % @max_result) + @range.begin
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mnemonic_words
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: