Sha256: 7e709a8dda6e74ada2806f22a3c2f2642367734f16c18b2cdc85d7f3b401ff8d
Contents?: true
Size: 632 Bytes
Versions: 1
Compression:
Stored size: 632 Bytes
Contents
class Wechat::JSAPI::Signature extend Wechat::Core::Common ## # 生成JS-SDK权限验证的签名 # http://mp.weixin.qq.com/wiki/11/74ad127cc054f6b80759c40f77ec03db.html#.E9.99.84.E5.BD.951-JS-SDK.E4.BD.BF.E7.94.A8.E6.9D.83.E9.99.90.E7.AD.BE.E5.90.8D.E7.AE.97.E6.B3.95 def self.create(link, ticket, timestamp, nonce) assert_present! :link, link assert_present! :ticket, ticket assert_present! :timestamp, timestamp assert_present! :nonce, nonce Digest::SHA1.hexdigest [ "url=#{link}", "jsapi_ticket=#{ticket}", "timestamp=#{timestamp}", "noncestr=#{nonce}" ].sort.join('&') end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
wechat-jsapi-0.1.1 | lib/wechat/jsapi/signature.rb |