Library hamming

To use this library in your code:

import crypto.hamming
Hamming code.

Functions

encode-16-11 in/any -> any
Encodes an 11-bit integer as a 16-bit integer with error correction bits.
Use fix-16-11 to check for errors and get the number back.

fix-16-11 in/any -> any
Checks the given in for possible errors.
Detects up to 2-bits error and corrects all 1-bit errors.
The in is a 16-bit number with possible errors.
Returns the corrected 11-bit number if there was no error or error correction was possible.
Returns null otherwise.