MessageDigest sha = MessageDigest.getInstance("MD5");
InputStream in = u.openStream();
byte[] data = new byte[128];
while (true) {
int bytesRead = in.read(data);
if (bytesRead < 0) { // end of stream
break;
}
sha.update(data, 0, bytesRead);
}
return sha.digest();