Skip to content

Instantly share code, notes, and snippets.

@avanpo
Created April 28, 2016 20:00
Show Gist options
  • Save avanpo/4d4e9872c47cb2fb72ad07c0e7df0d01 to your computer and use it in GitHub Desktop.
Save avanpo/4d4e9872c47cb2fb72ad07c0e7df0d01 to your computer and use it in GitHub Desktop.
/* Enumeration of the hexacode over GF(4). The four
* characters of GF(4) are represented as {0,1,2,3}.
*/
char hexacode[64][6] = {
{0, 0, 0, 0, 0, 0}, {0, 0, 1, 1, 1, 1},
{0, 0, 2, 2, 2, 2}, {0, 0, 3, 3, 3, 3},
{1, 1, 0, 0, 1, 1}, {2, 2, 0, 0, 2, 2},
{3, 3, 0, 0, 3, 3}, {1, 1, 1, 1, 0, 0},
{2, 2, 2, 2, 0, 0}, {3, 3, 3, 3, 0, 0},
{1, 1, 2, 2, 3, 3}, {1, 1, 3, 3, 2, 2},
{2, 2, 1, 1, 3, 3}, {2, 2, 3, 3, 1, 1},
{3, 3, 1, 1, 2, 2}, {3, 3, 2, 2, 1, 1},
{2, 3, 2, 3, 2, 3}, {3, 1, 3, 1, 3, 1},
{1, 2, 1, 2, 1, 2}, {2, 3, 3, 2, 3, 2},
{3, 2, 2, 3, 3, 2}, {3, 2, 3, 2, 2, 3},
{3, 1, 1, 3, 1, 3}, {1, 3, 3, 1, 1, 3},
{1, 3, 1, 3, 3, 1}, {1, 2, 2, 1, 2, 1},
{2, 1, 1, 2, 2, 1}, {2, 1, 2, 1, 1, 2},
{0, 1, 0, 1, 2, 3}, {0, 1, 1, 0, 3, 2},
{1, 0, 0, 1, 3, 2}, {1, 0, 1, 0, 2, 3},
{0, 1, 2, 3, 0, 1}, {0, 1, 3, 2, 1, 0},
{1, 0, 2, 3, 1, 0}, {1, 0, 3, 2, 0, 1},
{2, 3, 0, 1, 0, 1}, {2, 3, 1, 0, 1, 0},
{3, 2, 0, 1, 1, 0}, {3, 2, 1, 0, 0, 1},
{0, 2, 0, 2, 3, 1}, {0, 2, 2, 0, 1, 3},
{2, 0, 0, 2, 1, 3}, {2, 0, 2, 0, 3, 1},
{0, 2, 3, 1, 0, 2}, {0, 2, 1, 3, 2, 0},
{2, 0, 3, 1, 2, 0}, {2, 0, 1, 3, 0, 2},
{3, 1, 0, 2, 0, 2}, {3, 1, 2, 0, 2, 0},
{1, 3, 0, 2, 2, 0}, {1, 3, 2, 0, 0, 2},
{0, 3, 0, 3, 1, 2}, {0, 3, 3, 0, 2, 1},
{3, 0, 0, 3, 2, 1}, {3, 0, 3, 0, 1, 2},
{0, 3, 1, 2, 0, 3}, {0, 3, 2, 1, 3, 0},
{3, 0, 1, 2, 3, 0}, {3, 0, 2, 1, 0, 3},
{1, 2, 0, 3, 0, 3}, {1, 2, 3, 0, 3, 0},
{2, 1, 0, 3, 3, 0}, {2, 1, 3, 0, 0, 3}};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment