Class FSFnv1aInterleavedChecksumCalculator
- java.lang.Object
-
- org.tmatesoft.svn.core.internal.io.fs.index.FSFnv1aInterleavedChecksumCalculator
-
public class FSFnv1aInterleavedChecksumCalculator extends java.lang.ObjectA 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[]bufferprivate intbufferedprivate static longFNV1_BASE_32private static longFNV1_PRIME_32private static intHASH_SIZE_IN_BYTESprivate long[]hashesprivate static intSCALING
-
Constructor Summary
Constructors Constructor Description FSFnv1aInterleavedChecksumCalculator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intfinalizeChecksum()private intfinalizeChecksum(byte[] data, int offset, int length)private longfnv1a(long hash, byte[] data, int offset, int length)private intfnv1aInterleaved(byte[] data, int offset, int length)protected voidresetChecksum()voidupdate(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()
-
-