public static boolean isSha1String(final String string) {
    Preconditions.checkNotNull(string, "Error: String argument can't be null");
    return (string.length() == 40) && isHexString(string);
  }
Tests whether a given string is a valid SHA1 string.

@param string The string to check.
@return True, if the string is a valid SHA1 string. False, otherwise.
java/zylib/src/main/java/com/google/security/zynamics/zylib/general/Convert.java