Class Crc32c

  • All Implemented Interfaces:
    java.util.zip.Checksum

    class Crc32c
    extends ByteBufChecksum
    Implements CRC32-C as defined in: "Optimization of Cyclic Redundancy-CHeck Codes with 24 and 32 Parity Bits", IEEE Transactions on Communications 41(6): 883-892 (1993). The implementation of this class has been sourced from the Appendix of RFC 3309, but with masking due to Java not being able to support unsigned types.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int BYTE_MASK  
      private int crc  
      private static int[] CRC_TABLE  
      private static long LONG_MASK  
    • Constructor Summary

      Constructors 
      Constructor Description
      Crc32c()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static int crc32c​(int crc, int b)  
      long getValue()  
      void reset()  
      void update​(byte[] buffer, int offset, int length)  
      void update​(int b)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.zip.Checksum

        update, update
    • Field Detail

      • CRC_TABLE

        private static final int[] CRC_TABLE
      • crc

        private int crc
    • Constructor Detail

      • Crc32c

        Crc32c()
    • Method Detail

      • update

        public void update​(int b)
      • update

        public void update​(byte[] buffer,
                           int offset,
                           int length)
      • getValue

        public long getValue()
      • reset

        public void reset()
      • crc32c

        private static int crc32c​(int crc,
                                  int b)