cpw.mods.fml.repackage.com.nothome.delta

## Class Checksum

- java.lang.Object
- - cpw.mods.fml.repackage.com.nothome.delta.Checksum

-     public class Checksum
      extends Object

  Checksum computation class.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Checksum(SeekableSource source, int chunkSize)` Initialize checksums for source.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `findChecksumIndex(long hashf)` Finds the index of a checksum.
    `static char[]` | `getSingleHash()` 256 random hash values.
    `static long` | `incrementChecksum(long checksum, byte out, byte in, int chunkSize)` Increments a checksum.
    `static long` | `queryChecksum(ByteBuffer bb, int len)` Finds the checksum computed from the buffer.
    `String` | `toString()` Returns a debug `String`.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Checksum

          public Checksum(SeekableSource source,
                  int chunkSize)
                   throws IOException

      Initialize checksums for source. The checksum for the `chunkSize` bytes at offset `chunkSize` * i is inserted into a hash map.
      Throws:
        `IOException`

  - ### Method Detail

    - #### queryChecksum

          public static long queryChecksum(ByteBuffer bb,
                           int len)

      Finds the checksum computed from the buffer. Marks, gets, then resets the buffer.

    - #### incrementChecksum

          public static long incrementChecksum(long checksum,
                               byte out,
                               byte in,
                               int chunkSize)

      Increments a checksum.
      Parameters:
        `checksum` - initial checksum
        `out` - byte leaving view
        `in` - byte entering view
        `chunkSize` - size of chunks
      Returns:
        new checksum

    - #### getSingleHash

          public static char[] getSingleHash()

      256 random hash values.

    - #### findChecksumIndex

          public int findChecksumIndex(long hashf)

      Finds the index of a checksum.

    - #### toString

          public String toString()

      Returns a debug `String`.
      Overrides:
        `toString` in class `Object`