Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/pgp-word-list.rb
Instance Method Summary collapse
Instance Method Details
#to_pgp_hex ⇒ Object
6 7 8 |
# File 'lib/pgp-word-list.rb', line 6 def to_pgp_hex self.downcase.gsub(/[^a-z\ ]/,'').split().map(&:strip).to_pgp_hex.join('') end |
#to_pgp_words ⇒ Object
2 3 4 |
# File 'lib/pgp-word-list.rb', line 2 def to_pgp_words self.upcase.gsub(/[^A-F0-9]/,'').scan(/../).to_pgp_words.join(' ') end |