标签:
# md5签名
def md5_sign(data,key)
return OpenSSL::Digest::MD5.hexdigest(data+key)
end
# md5验签
def md5_verify(data,sign,key)
return true if sign.eql?
OpenSSL::Digest::MD5.hexdigest(data+key)
return false
end
标签:
原文地址:http://www.cnblogs.com/anion-blogs/p/5684913.html