| Executed features | Passed | Failures | Errors | Skipped | Success rate | Time |
|---|---|---|---|---|---|---|
| 1 | 1 | 0 | 0 | 0 | 100.0% | 0.047 seconds |
Hamming error-correction decoder
|
should decode data by Hamming algorithm
Return
|
|||||||||||||||||||||||||
|
Given:
|
received binary data with errors
|
||||||||||||||||||||||||
def data = received as byte[] |
|||||||||||||||||||||||||
|
When:
|
we decode the data using Hamming error-correction algorithm
|
||||||||||||||||||||||||
def decoded = coder.apply(data) |
|||||||||||||||||||||||||
|
Then:
|
the algorithm correct the data and we get original text
|
||||||||||||||||||||||||
decoded == text as byte[] |
|||||||||||||||||||||||||
|
Where:
|
we have one-bit errors in every byte of the data
|
||||||||||||||||||||||||
|
Examples:
|
|
7/7 passed
|
|||||||||||||||||||||||