Class FSFnv1aInterleavedChecksumCalculator


  • public class FSFnv1aInterleavedChecksumCalculator
    extends java.lang.Object
    A modification of FNV-1a algorithm. When given an input of 4k+b bytes the first 4k bytes input is divided into 4 arrays: of the 1st, 5th, 9th, 13th, ... bytes of the 2nd, 6th, 10th, 14th, ... bytes of the 3rd, 7th, 11th, 15th, ... bytes of the 4th, 8th, 12th, 16th, ... bytes Then 4 normal FNV-1a checksums are calculated from them. Then the checksums are written as raw a byte array and the last b bytes are appended. Finally normal FNV-1a checksum is calculated.
    • Constructor Detail

      • FSFnv1aInterleavedChecksumCalculator

        public FSFnv1aInterleavedChecksumCalculator()
    • Method Detail

      • update

        public void update​(byte[] data,
                           int offset,
                           int length)
      • finalizeChecksum

        public int finalizeChecksum()
      • finalizeChecksum

        private int finalizeChecksum​(byte[] data,
                                     int offset,
                                     int length)
      • fnv1aInterleaved

        private int fnv1aInterleaved​(byte[] data,
                                     int offset,
                                     int length)
      • fnv1a

        private long fnv1a​(long hash,
                           byte[] data,
                           int offset,
                           int length)
      • resetChecksum

        protected void resetChecksum()