(File file)
| 371 | } |
| 372 | |
| 373 | public static byte[] sha1(File file) throws IOException { |
| 374 | try { |
| 375 | return hash(file, MessageDigest.getInstance("SHA-1")); |
| 376 | } catch (NoSuchAlgorithmException e) { |
| 377 | throw new IOException(e); |
| 378 | } |
| 379 | } |
| 380 | |
| 381 | public static byte[] hash(File file, MessageDigest hash) throws IOException { |
| 382 | try ( |