def suffix_in_text(suffix: str, text: str) -> int:
    """Determine whether a hash suffix is in the text.

    :param suffix: Everything except the first 5 characters of the SHA1 hash of
    some password.
    :param text: The response text from the HIBP API.
    :return: The number of breaches the suffix was found in, or 0 if not present.
    """
    for line in text.split("\r\n"):
        line_split = line.split(":")
        if line_split[0] == suffix:
            try:
                return int(line_split[1])
            except ValueError:
                # If somehow the number can't be parsed, the suffix was already
                # found, so it has to be in at least one breach.
                return 1
    return 0