Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[SOLVED] Fast search method



  • Does Qt provide a fast way to search specific strings through multiple files containing hex data? If not, what algorithm is best suited for this kind of search?

    Right now I am using indexof.

    @

           if(temp.toHex().indexOf("564952555300") != -1){
    
           return item.name;
           qDebug() << "FOUND";
           qDebug() << filetoOpen;
            file.close();
           }
    
           if(temp.toHex().indexOf("563252555300") != -1){
            qDebug() << "FOUND";
            qDebug() << filetoOpen;
            file.close();
           }
    
           if(temp.toHex().indexOf("5642324555300") != -1){
            qDebug() << "FOUND";
            qDebug() << filetoOpen;
            file.close();
           }
    

    @


  • Lifetime Qt Champion

    Hi,

    Not directly no. You can have a look at the Qt Concurrent module. With it you can run your function several times in parallel.


Log in to reply