import string
import random


def random_int(length: int = 4) -> str:
    """
    generate a random str(int) and len == length
    :param length: Specified length，default = 4
    :return: str
    """

    all_char = string.digits
    lis = list()
    for _ in range(length):
        lis.extend(random.choices(all_char, k=1))
    return ''.join(lis)