import math


def bin_concat(int_1, int_2, int_1_byte=None, int_2_byte=None):
    """Concatenate two integer.
    Steps:
        1. Zero fill integers according to the given byte.
        2. Concatenate two integers in binary.

    Parameters
    ----------
    int_1 : int
        Left partition.
    int_2 : int
        Right partition.
    int_1_byte : int, optional
        If None is given, int_1 will be zero filled to the number which can be devided exactly by 8,
        otherwise int_1 will be zero filled to int_1_byte*8, by default None.
    int_2_byte : int, optional
        If None is given, int_2 will be zero filled to the number which can be devided exactly by 8,
        otherwise int_2 will be zero filled to int_2_byte*8, by default None.

    Returns
    -------
    int
        Concatenated value.
    """

    int_1_bin = bin(int_1)[2:]
    int_2_bin = bin(int_2)[2:]

    if int_1_byte is not None:
        int_1_bin = int_1_bin.zfill(int_1_byte * 8)
    else:
        int_1_bin = int_1_bin.zfill(math.ceil(len(int_1_bin) / 8) * 8)
    if int_2_byte is not None:
        int_2_bin = int_2_bin.zfill(int_2_byte * 8)
    else:
        int_2_bin = int_2_bin.zfill(math.ceil(len(int_2_bin) / 8) * 8)

    return int(int_1_bin + int_2_bin, base=2)