Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> The way this works is actually really really complex so I'll leave that out.

Bruh that's the whole reason I read the article. That's what I wanted to know.



In Dan Hollick's article:

> There is still a bunch of left over space after our data. This is where the error correction information is stored so that it can be read if partially obscured. The way this works is actually really really complex so I'll leave that out.

I find myself guilty of leaving it out of my page too, writing:

> (Note: The math behind computing the Reed-Solomon error correction codes is omitted because it is long, tedious, and not very interesting.)

Since there is some interest, let me try to explain a bit. Conceptually, it's simple. Put the data bytes (e.g. [A, B, C, D]) into polynomial coefficients (e.g. Ax^3 + Bx^2 + Cx^1 + Dx^0). Compute the Reed-Solomon generator polynomial, which is just a bunch of (x - a_i) terms multiplied together. Then divide your data polynomial by the generator polynomial, keep only the remainder (not the quotient), and that is your ECC polynomial. The catch is that all the polynomial coefficients take place over a finite field, which is a second layer of difficulty when it comes to explaining the math.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: