Package org.rabinfingerprint.polynomial

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


  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();
    }
  }

  @Override
View Full Code Here


  @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;

    if (bytesPerWindow > 0) {
      byteWindow.add(b);
View Full Code Here

   */
  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);
  }

  @Override
View Full Code Here

   */
  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();
    }
  }

  @Override
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.