def generateSignature(params)
hash = OpenSSL::HMAC.digest('sha256', "as2das231d12asdsada1212a", params)
result = Base64.encode64(hash)
#result.gsub!("\n", '')
puts "========result:#{result}"
signature = Digest::MD5.hexdigest(result)
puts "========signature====#{signature}"
end
signature = Digest::MD5.hexdigest(“gmBQdw9tdiWDFCUUshLNYdrHIRHyeTN8kPNWipUBbd8=”)
- 此时,打印的 signature 跟 md5 在线加密(https://md5jiami.51240.com)的结果一致