开发者

Translating algorithm/code from Ruby to PHP

开发者 https://www.devze.com 2022-12-13 07:06 出处:网络
digest = HMAC.digest(Digest.new(SHA1), Base64.decode64(key), HashString) return Base64.encode64(digest.to_s()).chomp()
digest = HMAC.digest(Digest.new(SHA1), Base64.decode64(key), HashString) return Base64.encode64(digest.to_s()).chomp()

What would开发者_Python百科 the above be in PHP?


This should do it:

$digest = hash_hmac("sha1", $hash_string, base64_decode($key), true);
return base64_encode($digest);
0

精彩评论

暂无评论...
验证码 换一张
取 消