Nous avons un service web python. Il a besoin d'un hachage comme paramètre. Le hachage en python est généré de cette façon.Python hmac et C# hmac
hashed_data = hmac.new("ant", "bat", hashlib.sha1)
print hashed_data.hexdigest()
Maintenant, voici comment générer le hachage à partir de C#.
ASCIIEncoding encoder = new ASCIIEncoding();
Byte[] code = encoder.GetBytes("ant");
HMACSHA1 hmSha1 = new HMACSHA1(code);
Byte[] hashMe = encoder.GetBytes("bat");
Byte[] hmBytes = hmSha1.ComputeHash(hashMe);
Console.WriteLine(Convert.ToBase64String(hmBytes));
Cependant, je vais sortir avec un résultat différent.
Dois-je changer l'ordre du hachage?
Merci,
Jon