congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Sha1CollisionException.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.eclipse.jgit.util.sha1.Sha1CollisionException
constructor

Best Java code snippets using org.eclipse.jgit.util.sha1.Sha1CollisionException.<init> (Showing top 2 results out of 315)

origin: org.eclipse.jgit/org.eclipse.jgit

private void finish() {
  int bufferLen = (int) (length & 63);
  if (bufferLen > 55) {
    // Last block is too small; pad, compress, pad another block.
    buffer[bufferLen++] = (byte) 0x80;
    Arrays.fill(buffer, bufferLen, 64, (byte) 0);
    compress(buffer, 0);
    Arrays.fill(buffer, 0, 56, (byte) 0);
  } else {
    // Last block can hold padding and length.
    buffer[bufferLen++] = (byte) 0x80;
    Arrays.fill(buffer, bufferLen, 56, (byte) 0);
  }
  // SHA-1 appends the length of the message in bits after the
  // padding block (above). Here length is in bytes. Multiply by
  // 8 by shifting by 3 as part of storing the 64 bit byte length
  // into the two words expected in the trailer.
  NB.encodeInt32(buffer, 56, (int) (length >>> (32 - 3)));
  NB.encodeInt32(buffer, 60, (int) (length << 3));
  compress(buffer, 0);
  if (foundCollision) {
    ObjectId id = h.toObjectId();
    LOG.warn("possible SHA-1 collision " + id.name()); //$NON-NLS-1$
    throw new Sha1CollisionException(id);
  }
}
origin: berlam/github-bucket

private void finish() {
  int bufferLen = (int) (length & 63);
  if (bufferLen > 55) {
    // Last block is too small; pad, compress, pad another block.
    buffer[bufferLen++] = (byte) 0x80;
    Arrays.fill(buffer, bufferLen, 64, (byte) 0);
    compress(buffer, 0);
    Arrays.fill(buffer, 0, 56, (byte) 0);
  } else {
    // Last block can hold padding and length.
    buffer[bufferLen++] = (byte) 0x80;
    Arrays.fill(buffer, bufferLen, 56, (byte) 0);
  }
  // SHA-1 appends the length of the message in bits after the
  // padding block (above). Here length is in bytes. Multiply by
  // 8 by shifting by 3 as part of storing the 64 bit byte length
  // into the two words expected in the trailer.
  NB.encodeInt32(buffer, 56, (int) (length >>> (32 - 3)));
  NB.encodeInt32(buffer, 60, (int) (length << 3));
  compress(buffer, 0);
  if (foundCollision) {
    ObjectId id = h.toObjectId();
    LOG.warn("possible SHA-1 collision " + id.name()); //$NON-NLS-1$
    throw new Sha1CollisionException(id);
  }
}
org.eclipse.jgit.util.sha1Sha1CollisionException<init>

Javadoc

Initialize with default message.

Popular methods of Sha1CollisionException

    Popular in Java

    • Making http requests using okhttp
    • onCreateOptionsMenu (Activity)
    • addToBackStack (FragmentTransaction)
    • getSharedPreferences (Context)
    • VirtualMachine (com.sun.tools.attach)
      A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
    • BigDecimal (java.math)
      An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
    • TreeMap (java.util)
      Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
    • JFileChooser (javax.swing)
    • Options (org.apache.commons.cli)
      Main entry-point into the library. Options represents a collection of Option objects, which describ
    • Logger (org.slf4j)
      The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
    • 21 Best IntelliJ Plugins
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now