private static String sha1hash ( Collection < String > nquads ) { try { // create SHA-1 digest final MessageDigest md = MessageDigest . getInstance ( "SHA-1" ) ; for ( final String nquad : nquads ) { md . update ( nquad . getBytes ( "UTF-8" ) ) ; } return encodeHex ( md . digest ( ) ) ; } catch ( final NoSuchAlgorithmException e ) { throw new RuntimeException ( e ) ; } catch ( final UnsupportedEncodingException e ) { throw new RuntimeException ( e ) ; } }
A helper class to sha1 hash all the strings in a collection