public boolean findErrorLocations_BruteForce ( GrowQueue_I8 errorLocator , int messageLength , GrowQueue_I32 locations ) { locations . resize ( 0 ) ; for ( int i = 0 ; i < messageLength ; i ++ ) { if ( math . polyEval_S ( errorLocator , math . power ( 2 , i ) ) == 0 ) { locations . add ( messageLength - i - 1 ) ; } } // see if the expected number of errors were found return locations . size == errorLocator . size - 1 ; }
Creates a list of bytes that have errors in them