1. A method for detecting errors in data, comprising: encoding the data into a codeword using a generation polynomial; transmitting the codeword over a channel; receiving the transmitted codeword; generating syndromes for the received codeword using the generation polynomial, the syndromes comprising a plurality of syndrome symbols; providing a plurality of syndrome windows, each of the syndrome windows comprising a plurality of sub-windows and corresponding to a set of syndrome symbols; determining a number of non-zero terms of sub-windows of each of the syndrome windows; and selecting at least one syndrome window having a least number of non-zero terms of sub-windows.