Compute SHA256 Hash in Android/Java and C#
Your Java code is wrong: you are adding the input bytes twice. If you are calculating this in one go, you need to either call only digest(bytes)
or call digest()
after update(bytes)
;
Your Java code is wrong: you are adding the input bytes twice. If you are calculating this in one go, you need to either call only digest(bytes)
or call digest()
after update(bytes)
;