Generate hamming code-words with given minimum distance
To have a minimum distance of 3, it's necessary that a single change to a data bit changes at least two parity bits as well.  Therefore, each data bit must appear in the equations of either 2 or 3 parity bits.

Additionally, no two data bits can have the same pattern of appearance in the parity bits, or else changing both those two data bits would result in a second valid codeword at a distance of only 2.

As there are four data bits, and $$\left ( \array{3 \\ 2} \right) + \left( \array{3 \\ 3} \right) = 3 + 1 = 4$$

all combinations of 2 and 3 parity bits must appear.

Thus the generation matrix is

$$\left[ \array{1 &amp; 0 &amp; 0 &amp; 0\\0 &amp; 1 &amp; 0 &amp; 0\\0 &amp; 0 &amp; 1 &amp; 0\\0 &amp; 0 &amp; 0 &amp; 1\\1 &amp; 0 &amp; 1 &amp; 1\\1 &amp; 1 &amp; 0 &amp; 1\\1 &amp; 1 &amp; 1 &amp; 0} \right]$$

and all other valid standard-form generation matrices are just permutations.

All the code words can then be generated by matrix multiplication using a finite field, commonly designated GF(2), where the additive operation is XOR and the multiplicative operation is AND.

$$\left[ \array{1 &amp; 0 &amp; 0 &amp; 0\\0 &amp; 1 &amp; 0 &amp; 0\\0 &amp; 0 &amp; 1 &amp; 0\\0 &amp; 0 &amp; 0 &amp; 1\\1 &amp; 0 &amp; 1 &amp; 1\\1 &amp; 1 &amp; 0 &amp; 1\\1 &amp; 1 &amp; 1 &amp; 0} \right] \left[ \array{d_0 \\ d_1 \\ d_2 \\ d_3} \right ] = \left[ \array{d_0 \\ d_1 \\ d_2 \\ d_3 \\ d_0 \oplus d_2 \oplus d_3 \\ d_0 \oplus d_1 \oplus d_3 \\ d_0 \oplus d_1 \oplus d_2} \right]$$

If your bullet points are requirements rather than a plan, reorder the rows to place the parity bits in the specified positions.