def to_bytes(value: int, size: int) -> bytearray:
    """
    Converts an integer value into a bytearray.

    :param int value:   Input value.
    :param int size:    Number of bytes.

    :return: Value bytes.
    :rtype: bytearray
    """
    return bytearray(value.to_bytes(length=size, byteorder='big', signed=False))