If I generate the SHA-256 hash in the language "GO", I get a different byte-Array compared to the Java equivalent.
This is the GO version:
fmt.Println(getSha256([]byte("5nonce=5")))
The resulting array looks like:
41 79 186 235 199 123 95 226 16 59 51 161 112 245 192 50 21 66 180 250 179 109 153 18 233 148 16 237 156 69 163 150]
This one should do the same in Java code:
MessageDigest md = MessageDigest.getInstance("SHA-256");
md.update("5nonce=5".getBytes());
byte[] digest = md.digest();
But results in this byte array
[41, 79, -70, -21, -57, 123, 95, -30, 16, 59, 51, -95, 112, -11, -64, 50, 21, 66, -76, -6, -77, 109, -103, 18, -23, -108, 16, -19, -100, 69, -93, -106]
Why are they different? How do I need to change the java version to work exactly like the Go version?