… | |
… | |
714 | * https://stackoverflow.com/questions/23122312/crc-calculation-of-a-mostly-static-data-stream/23126768 |
714 | * https://stackoverflow.com/questions/23122312/crc-calculation-of-a-mostly-static-data-stream/23126768 |
715 | * |
715 | * |
716 | * notes: |
716 | * notes: |
717 | * - I squeezed everything into one function to keep global namespace clean (original code two helper functions) |
717 | * - I squeezed everything into one function to keep global namespace clean (original code two helper functions) |
718 | * - most original comments are still in place, I added comments where these helper functions where made inline code |
718 | * - most original comments are still in place, I added comments where these helper functions where made inline code |
719 | * - performance-wise there isn't any differenze to the original zlib/pigz code |
719 | * - performance-wise there isn't any difference to the original zlib/pigz code |
720 | */ |
720 | */ |
721 | |
721 | |
722 | /* degenerated case */ |
722 | /* degenerated case */ |
723 | if (lengthB == 0) |
723 | if (lengthB == 0) |
724 | return crcA; |
724 | return crcA; |