Class FSFnv1aInterleavedChecksumCalculator

java.lang.Object
org.tmatesoft.svn.core.internal.io.fs.index.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.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final byte[]
     
    private int
     
    private static final long
     
    private static final long
     
    private static final int
     
    private final long[]
     
    private static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    private int
    finalizeChecksum(byte[] data, int offset, int length)
     
    private long
    fnv1a(long hash, byte[] data, int offset, int length)
     
    private int
    fnv1aInterleaved(byte[] data, int offset, int length)
     
    protected void
     
    void
    update(byte[] data, int offset, int length)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • SCALING

      private static final int SCALING
      See Also:
    • HASH_SIZE_IN_BYTES

      private static final int HASH_SIZE_IN_BYTES
      See Also:
    • FNV1_BASE_32

      private static final long FNV1_BASE_32
      See Also:
    • FNV1_PRIME_32

      private static final long FNV1_PRIME_32
      See Also:
    • hashes

      private final long[] hashes
    • buffer

      private final byte[] buffer
    • buffered

      private int buffered
  • Constructor Details

    • FSFnv1aInterleavedChecksumCalculator

      public FSFnv1aInterleavedChecksumCalculator()
  • Method Details

    • 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()