阅读背景:

获取Ruby的OpenSSL::HMAC.hexdigest()的输出与PHP的hash_hmac()相同

来源:互联网 

I'm trying to use the API of a web service provider. They don't have an example in Ruby, but they do have one for PHP, and I'm trying to interpret between the two. The API examples always use "true" on PHP's hash_hmac() call, which produces a binary output. The difference seems to be that Ruby's OpenSSL::HMAC.hexdigest() function always returns text. (If I change the PHP call to "false" they return the same value.) Does anyone know of a way to "encode" the text returned from OpenSSL::HMAC.hexdigest() to get the same thing as returned from a hash_hmac('sha256', $text, $key, true)?I'm trying to use the API of a web service prov




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: