def pad(data: bytes, size: int, value: int = 0) -> bytes:
    """Padds given data with given value until its length is not multiple by size

    Parameters:
        data: bytes
            Data to pad
        
        size: int
            Required size data length must be multiple to

        value: int
            Value to add to data. 0 by default
    """
    value = (value & 0xff)
    while len(data) % size:
        data += bytes([value])
    return data