How i can do below JS in C#?
var contentHash = CryptoJS.SHA512(Json.stringify(requestBody)).toString(CryptoJS.enc.Hex)
Try below code but not working.
{
var encoding = new UTF8Encoding();
var messageBytes = encoding.GetBytes(str);
var keyBytes = encoding.GetBytes(cypherkey);
using var hmacsha256 = new HMACSHA256(keyBytes);
var hashmessage = hmacsha256.ComputeHash(messageBytes);
var myStr= Convert.ToBase64String(hashmessage);
return myStr;
}