MessageDigest sha = MessageDigest.getInstance("SHA");
byte[] data = new byte[128];
while (true) {
int bytesRead = in.read(data);
if (bytesRead < 0) break;
sha.update(data, 0, bytesRead);
}
byte[] result = sha.digest();
for (int i = 0; i < result.length; i++) {
System.out.print(result[i] + " ");
}
System.out.println();
System.out.println(new BigInteger(data));