public static String sha1sum(File file){
                String localSha1Sum = null;
                if (file.exists() && file.isFile() && file.canRead()){
			try {
				MessageDigest md = MessageDigest.getInstance("SHA-1");
				DigestInputStream dis = new DigestInputStream(new FileInputStream(file), md);
				dis.on(true);

				while (dis.read() != -1){
					;
				}
				byte[] b = md.digest();
				localSha1Sum = getHexString(b);
			} catch (Exception ex) {
				ex.printStackTrace();
			}
		} else {
			System.out.println("impossible de trouver le fichier : "+file.getAbsolutePath());
		}
                return localSha1Sum;
        }