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

    • Parsing JSON documents to java classes using gson
    • scheduleAtFixedRate (Timer)
    • getExternalFilesDir (Context)
    • findViewById (Activity)
    • BigDecimal (java.math)
      An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
    • URI (java.net)
      A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
    • NoSuchElementException (java.util)
      Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
    • Queue (java.util)
      A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
    • CountDownLatch (java.util.concurrent)
      A synchronization aid that allows one or more threads to wait until a set of operations being perfor
    • Handler (java.util.logging)
      A Handler object accepts a logging request and exports the desired messages to a target, for example
    • Top Sublime Text plugins
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

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