Package org.rabinfingerprint.polynomial

Examples of org.rabinfingerprint.polynomial.Polynomial.shiftLeft()


  }

  private void precomputePopTable() {
    for (int i = 0; i < 256; i++) {
      Polynomial f = Polynomial.createFromLong(i);
      f = f.shiftLeft(BigInteger.valueOf(bytesPerWindow * 8));
      f = f.mod(poly);
      popTable[i] = f.toBigInteger().longValue();
    }
  }

View Full Code Here


   * If we have passed overflowed our window, we pop a byte
   */
  @Override
  public synchronized void pushByte(byte b) {
    Polynomial f = fingerprint;
    f = f.shiftLeft(byteShift);
    f = f.or(Polynomial.createFromLong(b & 0xFFL));
    f = f.mod(poly);

    fingerprint = f;

View Full Code Here

   * in a k-bit number at the end of the calculation.
   */
  public synchronized void popByte() {
    byte b = byteWindow.poll();
    Polynomial f = Polynomial.createFromLong(b & 0xFFL);
    f = f.shiftLeft(windowShift);
    f = f.mod(poly);

    fingerprint = fingerprint.xor(f);
  }

View Full Code Here

   * {@link #pushByte} and {@link #popByte}
   */
  private void precomputePushTable() {
    for (int i = 0; i < 512; i++) {
      Polynomial f = Polynomial.createFromLong(i);
      f = f.shiftLeft(poly.degree());
      f = f.xor(f.mod(poly));
      pushTable[i] = f.toBigInteger().longValue();
    }
  }

View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.