def getNumsFromBytes(bytes, bitsPerComponent=8):
    """
        Makes the conversion between bytes and numbers, depending on the number of bits used per component.

        @param bytes: String representing the bytes to be converted
        @param bitsPerComponent: Number of bits needed to represent a component
        @return: A tuple (status,statusContent), where statusContent is a list of numbers in case status = 0 or an error in case status = -1
    """
    if not isinstance(bytes, str):
        return -1, 'bytes must be a string'
    if not isinstance(bitsPerComponent, int):
        return -1, 'bitsPerComponent must be an integer'
    outputComponents = []
    bitsStream = ''
    for byte in bytes:
        try:
            bitsRepresentation = bin(ord(byte))
            bitsRepresentation = bitsRepresentation.replace('0b', '')
            bitsRepresentation = '0' * (8 - len(bitsRepresentation)
                ) + bitsRepresentation
            bitsStream += bitsRepresentation
        except:
            return -1, 'Error in conversion from bytes to bits'
    try:
        for i in range(0, len(bitsStream), bitsPerComponent):
            bytes = ''
            bits = bitsStream[i:i + bitsPerComponent]
            num = int(bits, 2)
            outputComponents.append(num)
    except:
        return -1, 'Error in conversion from bits to bytes'
    return 0, outputComponents
