Hawkynt

Varshamov-Tenengolts Code

Code correcting single insertion, deletion, or asymmetric (0โ†’1) error. Rate-1 code with log(n+1) redundancy bits. Uses weighted checksum: sum of iยทx_i โ‰ก a (mod n+1). Critical for DNA storage and optical communications where synchronization errors occur. Remarkably efficient for indel correction.

Properties

Property Value
Category Error Correction
Sub-category Insertion/Deletion Code
Security status ๐ŸŽ“ Educational Only
Complexity Advanced
Inventor R. R. Varshamov, G. M. Tenengolts
Year 1965
Origin ๐Ÿ‡ท๐Ÿ‡บ Russia
Source algorithms/ecc/varshamov-tenengolts.js

Security

Status: ๐ŸŽ“ Educational Only

Known vulnerabilities

Issue Description Mitigation
Single Error Only Can only correct single insertion OR deletion OR asymmetric error, not multiple. โ€”
Modulo Constraint Requires knowledge of original word length for proper decoding. โ€”

Documentation

References

Test vectors

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

Vector 1 โ€” VT (7,0) all zeros

Field Value
n 7
a 0
input 00000000000000
expected 00000000000000

Vector 2 โ€” VT (7,0) sum=8: positions 1,7

Field Value
n 7
a 0
input 01000000000001
expected 01000000000001

Vector 3 โ€” VT (7,0) sum=8: positions 2,6

Field Value
n 7
a 0
input 00010000000100
expected 00010000000100

Vector 4 โ€” VT (7,3) sum=3: position 3

Field Value
n 7
a 3
input 00000100000000
expected 00000100000000

โ† All algorithms