Module: Reapal::Sign::MD5
- Defined in:
- lib/reapal/sign/md5.rb
Class Method Summary collapse
Class Method Details
.sign(content, key) ⇒ Object
6 7 8 9 10 |
# File 'lib/reapal/sign/md5.rb', line 6 def self.sign(content, key) md5 = Digest::MD5.new md5 << (content + key) md5.hexdigest end |
.verify?(content, key, sign_str) ⇒ Boolean
12 13 14 |
# File 'lib/reapal/sign/md5.rb', line 12 def self.verify?(content, key, sign_str) sign(content, key) == sign_str end |