# 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
时间: 2024-11-09 00:29:47
# 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