public static boolean isValidSHA1(String s){
  return s.matches("[a-fA-F0-9]{40}");
}

public static boolean isValidSHA1 ( String s ) { return s . matches ( "[a-fA-F0-9]{40}" ) ; }
checks if given string is a valid sha1 hash string using pattern
