Skip to content

vhuntsman/Hamming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hamming

This library corrects 1 bit error given a codeword.
Theoretically supports up to 2048 bytes.
Felt inspired to write a Hamming code library after watching the esteemed Grant Sanderson's video on Hamming Codes:

Part 1
Part 2

It's a bit re-inventing the wheel, but it was fun to code it.

Build

Target framework: .NET Core 2.2

Usage

  • Generate an ecc checksum by providing a byte array, e.g.,

int checksum = HamEcc.GenerateChecksum(data);

  • Verify the data against checksum. A tuple containing the error positions in the data or checksum will be returned.
    (-1, -1) is returned for zero errors, e.g.,

(int dataErrorPos, int eccErrorPos) result = HamEcc.Verify(data, checksum);

About

A hamming ECC library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages