php与c++;hmac不一致
我正在尝试集成一个游戏引擎(c++)和一个服务器(php) c++ php 问题是我的哈希值不匹配,我不确定我做错了什么php与c++;hmac不一致,php,c++,hmac,Php,C++,Hmac,我正在尝试集成一个游戏引擎(c++)和一个服务器(php) c++ php 问题是我的哈希值不匹配,我不确定我做错了什么 char key[] = "012345678"; // The data that we're going to hash using HMAC char hashStr[] = "hello world"; unsigned char* result = HMAC(EVP_sha256(), key, strlen(key) , (unsigned char*)has
char key[] = "012345678";
// The data that we're going to hash using HMAC
char hashStr[] = "hello world";
unsigned char* result = HMAC(EVP_sha256(), key, strlen(key) , (unsigned char*)hashStr, strlen(hashStr), NULL, NULL);
$key = "012345678";
$msg = "hello world";
$hash = hash_hmac ( 'sha256' , $msg , $key , true );
echo(bin2hex($hash));