def _find_positions(hash_list, pHash, pattern, text):
    """
    Function for finding position of pattern in text

    Args:
        hash_list: list of hashes from text
        pHash: hash of pattern
        pattern: pattern itself
        text:  text itself

    Returns:
        list of positions where pattern was found

    """

    result = []
    for i in range(0, len(text) - len(pattern) + 1):
        if pHash != hash_list[i]:
            continue
        if text[i:i + len(pattern)] == pattern:  # Only if hashes are the same we compare text symbol by symbol
            result.append(i)
    return result