import re


def _re_is_digit_string(str_, str_len):
    """Digit string validation

    Parameters
    ----------
    str_ : str
        Digit string to validate
    str_len : int
        Digit string expected length

    Returns
    -------
    bool
        True if valid, False otherwise

    Raises
    ------
    TypeError
        If str_len is not positive int
    """
    regex = "^[0-9]{%s}$" % str_len
    if not isinstance(str_, str):
        return False
    if not isinstance(str_len, int):
        raise TypeError("_re_is_digit_string - str_len is not int")
    if str_len < 0:
        raise Exception("_re_is_digit_string - str_len < 0")
    ret = re.match(regex, str_)
    return True if ret is not None else False