I have a C# function for SHA256 hashing that I need to convert to Delphi function. I have tried converting it, but the hash values returned do not match the values the vendor says I should get
public static string GenerateDigest() {
var digest = "";
var bodyText = "{ your JSON payload }";
using (var sha256hash = SHA256.Create()) {
byte[] payloadBytes = sha256hash
.ComputeHash(Encoding.UTF8.GetBytes(bodyText));
digest = Convert.ToBase64String(payloadBytes);
digest = "SHA-256=" + digest;
}
return digest;
}