C# equivalent to hash_hmac in PHP
问题 using .NET and C# i need to provide an integrity string using HMAC SHA512 to a PHP server . Using in C# : Encoding encoding = Encoding.UTF8; byte[] keyByte = encoding.GetBytes(key); HMACSHA512 hmacsha512 = new HMACSHA512(keyByte); byte[] messageBytes = encoding.GetBytes(message); byte[] hashmessage = hmacsha512.ComputeHash(messageBytes); return(ByteToString(hashmessage).toUpper()); But it doesn't match with PHP hash_hmac() PHP code : $hmac = strtoupper(hash_hmac($pbx_hash, $msg, $binKey)); I