Hawkynt

Lexicographic Code

Greedy construction method for error correction codes. Builds codebook by adding codewords in lexicographic order that maintain minimum distance constraint. Simple construction yields codes including Hamming and Golay codes. Demonstrates fundamental code construction principles.

Properties

Property Value
Category Error Correction
Sub-category Constructed Code
Security status šŸŽ“ Educational Only
Complexity Intermediate
Inventor Unknown (classical technique)
Year 1960
Origin Not specified
Source algorithms/ecc/lexicographic-code.js

Security

Status: šŸŽ“ Educational Only

Known vulnerabilities

Issue Description Mitigation
Suboptimal Parameters Greedy construction does not always yield optimal codes. May have fewer codewords than best-known codes. —
Construction Complexity Building codebook requires checking all previous codewords, O(n²) complexity. —

Documentation

References

Test vectors

4 vectors ship with this algorithm and run in the test suite. Byte values are hexadecimal.

Vector 1 — Lexicographic (7,3) zeros

Field Value
n 7
d 3
input 00000000
expected 00000000000000

Vector 2 — Lexicographic (7,3) pattern 1

Field Value
n 7
d 3
input 00000001
expected 00000000010101

Vector 3 — Lexicographic (7,3) pattern 2

Field Value
n 7
d 3
input 00000100
expected 00000101000001

Vector 4 — Lexicographic (7,3) pattern 3

Field Value
n 7
d 3
input 00010000
expected 00010001000100

← All algorithms