Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8310492

Add CRC32/CRC32C initialization

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • None
    • core-libs
    • None

      The existing CRC32 and CRC32C in java.util.zip have only the default constructor and reset method to an initial value zero.

      There are applications where non-zero initial values are useful: resuming the running checksum, concatenating inputs to a common header, or getting the initial value from a transmission. In these cases, restarting from a non-zero value is expensive or impossible.

      There are CRC32 initialization APIs provided in zlib and Python.
      https://github.com/madler/zlib/blob/04f42ceca40f73e2978b50e93806c2a18c1281fc/crc32.c#L1072
      https://docs.python.org/3/library/zlib.html#zlib.crc32

            yftsai Yi-Fan Tsai
            yftsai Yi-Fan Tsai
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: