public static ByteString sha1(ByteString s) {
    try {
      MessageDigest messageDigest = MessageDigest.getInstance("SHA-1");
      byte[] sha1Bytes = messageDigest.digest(s.toByteArray());
      return ByteString.of(sha1Bytes);
    } catch (NoSuchAlgorithmException e) {
      throw new AssertionError(e);
    }
  }
public static ByteString sha1 ( ByteString s ) { try { MessageDigest messageDigest = MessageDigest . getInstance ( "SHA-1" ) ; byte [ ] sha1Bytes = messageDigest . digest ( s . toByteArray ( ) ) ; return ByteString . of ( sha1Bytes ) ; } catch ( NoSuchAlgorithmException e ) { throw new AssertionError ( e ) ; } }
Returns a SHA-1 hash of {@code s}.