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 byte[]
buffer
private int
buffered
private static long
FNV1_BASE_32
private static long
FNV1_PRIME_32
private static int
HASH_SIZE_IN_BYTES
private long[]
hashes
private static int
SCALING
-
Constructor Summary
Constructors Constructor Description FSFnv1aInterleavedChecksumCalculator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
finalizeChecksum()
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
resetChecksum()
void
update(byte[] data, int offset, int length)
-
-
-
Field Detail
-
SCALING
private static final int SCALING
- See Also:
- Constant Field Values
-
HASH_SIZE_IN_BYTES
private static final int HASH_SIZE_IN_BYTES
- See Also:
- Constant Field Values
-
FNV1_BASE_32
private static final long FNV1_BASE_32
- See Also:
- Constant Field Values
-
FNV1_PRIME_32
private static final long FNV1_PRIME_32
- See Also:
- Constant Field Values
-
hashes
private final long[] hashes
-
buffer
private final byte[] buffer
-
buffered
private int buffered
-
-
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()
-
-