Springer Science+Business Media, LLC 2012. All rights reserved. Let q ={0,1,, q?1} be an alphabet of order q. A q-ary (unrestricted) code C of length n and size | C | is a subset of qn containing | C | elements called codewords. The Hamming weight wt(c) of a codeword c is the number of its nonzero entries. A constant-weight code is a code where all the codewords have the same Hamming weight. The Hamming distance d(c, c ) between two codewords c and c is the number of positions where they have different entries. The minimum Hamming distance of a code C is the largest integer such that , c? C, d(c, c?) .