def int_to_bytes(num, lens):
    """
    int转bytes
    :param num: 整数
    :param lens: 目标bytes的字节长度
    :return: bytes类型
    """
    int_bytes = int(num).to_bytes(lens, byteorder='big')
    return int_bytes