Skip to content
Advertisement

What is the equivalent of hashing Java code into C#?

I have a strange problem in getting equivalent hash code from C# code translated into Java. I don’t know, what MessageDigest update method do. It should only update the contents of digest and should compute hash after calling digest.

Same thing I am doing in C# with SHAManaged512.ComputeHash(content). But I am not getting same hash code.

Following is the Java code.

JavaScript

Following is C# Code

JavaScript

Advertisement

Answer

I had the exact same issue. Its been two years since you asked but just in case someone comes across this question, here’s the solution

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement