Class: RongCloud::Signer
- Inherits:
-
Object
- Object
- RongCloud::Signer
- Defined in:
- lib/rongcloud/signer.rb
Class Method Summary collapse
Class Method Details
.generate(params) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/rongcloud/signer.rb', line 3 def self.generate(params) app_secret = params.fetch(:app_secret) nonce = params.fetch(:nonce) = params.fetch(:timestamp) string = "#{app_secret}#{nonce}#{}" Digest::SHA1.hexdigest(string) end |
.verify?(params) ⇒ Boolean
11 12 13 |
# File 'lib/rongcloud/signer.rb', line 11 def self.verify?(params) params.fetch(:signature) == generate(params) end |