Open SheetJSDev opened 2 years ago
@SheetJSDev Thank you so much for your clarification I spent hours trying to figure out why the signature wasn't correct 🥲
The website cited in the other issue uses the phrase "Initial Value" at the top of the page and the phrase "Initial CRC value" in the Description, so it's easy to see how @alexgorbatchev misinterpreted the default case.
discussed in #66 but the original analysis was incorrect because it did not actually test the case where 0 is the previous value.
Ruby code:
Using
crc-32
:Using
crc
:The error is in the special 0 case, which probably stems from a misinterpretation of the english description.
The APPNOTE.TXT specification states:
Some developers misinterpret that to mean the seed starts at -1. but it's actually saying that the
crc
variable starts at -1:There is no need to special-case the 0, and the TS code might as well be simplified to: