Module: WxOpendata::Signature
- Defined in:
- lib/wx_opendata/signature.rb
Instance Method Summary collapse
Instance Method Details
#check(signature, timestamp, nonce, encrypt) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/wx_opendata/signature.rb', line 4 def check(signature, , nonce, encrypt) tmp_arr = [token, , nonce] tmp_arr << encrypt unless encrypt.nil? sign = tmp_arr.compact.collect(&:to_s).sort.join Digest::SHA1.hexdigest sign == signature end |