A method for error detection, comprising: a) defining a parity checking matrix H comprising a data segment comprising N data columns and a parity segment comprising K parity columns: b) populating the 2 (K-1) -1 columns in the right-most portion of the parity checking matrix H with column vectors having odd weights; c) populating the N+K-2 (K-1) +1 columns in the left-most portion of the parity checking matrix H with column vectors having even weights; d) calculating a plurality of combination vectors by summing each pair of adjacent columns of the parity checking matrix H; e) determining whether each column vector of the parity checking matrix H is unique and not equal to any of the plurality of combination vectors; f) in response to a determination that each column vector of the parity checking matrix H is unique and not equal to any of the plurality of combination vectors, storing the parity checking matrix H for use in decoding received codewords; g) in response to a determination that at least one column vector of the parity checking matrix H is not unique or equal to any combination vector, returning to step b) to re-populate the column vectors with new values; h) receiving , by an error correction code device, a codeword comprising N data bits and K parity bits, the codeword being encoded using a generator matrix G, which is based on the parity check matrix H; i) generating , via the error correction code device, using the parity checking matrix H, a syndrome vector associated with the received codeword; and j) detecting , via the error correction code device, an adjacent two bit error in the codeword based on a comparison of the syndrome vector to the parity checking matrix H. a) defining a parity checking matrix H comprising a data segment comprising N data columns and a parity segment comprising K parity columns: b) populating the 2 (K-1) -1 columns in the right-most portion of the parity checking matrix H with column vectors having odd weights; c) populating the N+K-2 (K-1) +1 columns in the left-most portion of the parity checking matrix H with column vectors having even weights; d) calculating a plurality of combination vectors by summing each pair of adjacent columns of the parity checking matrix H; e) determining whether each column vector of the parity checking matrix H is unique and not equal to any of the plurality of combination vectors; f) in response to a determination that each column vector of the parity checking matrix H is unique and not equal to any of the plurality of combination vectors, storing the parity checking matrix H for use in decoding received codewords; g) in response to a determination that at least one column vector of the parity checking matrix H is not unique or equal to any combination vector, returning to step b) to re-populate the column vectors with new values; h) receiving , by an error correction code device, a codeword comprising N data bits and K parity bits, the codeword being encoded using a generator matrix G, which is based on the parity check matrix H; i) generating , via the error correction code device, using the parity checking matrix H, a syndrome vector associated with the received codeword; and j) detecting , via the error correction code device, an adjacent two bit error in the codeword based on a comparison of the syndrome vector to the parity checking matrix H. <EOS>