I have the following code in python:
myBytes = m.digest()
for one in myBytes:
print(one, end=' ')
print(end='\n')
intlist = int.from_bytes(myBytes, 'little')
print("intlist", intlist)
the above code prints the following result
72 230 166 56 69 98 5 189 49 43 129 54 237 2 147 230
intlist 306485766027497339553611008967975560776
Now I want to achieve the exact same result in java. This is my code so far:
byte[] myBytes = md.digest();
System.out.println(Arrays.toString(myBytes));
BigInteger intlist = new BigInteger(myBytes);
System.out.println("intlist=" + intlist);
and the result I get from this is the following:
[72, -26, -90, 56, 69, 98, 5, -67, 49, 43, -127, 54, -19, 2, -109, -26]
intlist=96902015312221227689534558263304164326
The result in java is wrong for what I want to do. I want to get the exact same values as on python code.
Any ideas?