Interface B2Sha1


  • public interface B2Sha1
    • Method Summary

      Static Methods 
      Modifier and Type Method Description
      static byte[] binarySha1OfBytes​(byte[] data)
      Returns the SHA-1 of the given bytes, as binary data.
      static byte[] binarySha1OfInputStream​(java.io.InputStream in)
      Returns the SHA-1 of the given InputStream, as binary data.
      static java.security.MessageDigest createSha1MessageDigest()
      Returns a SHA-1 MessageDigest, which we expect to always be available.
      static boolean equalHexSha1s​(java.lang.String sha1a, java.lang.String sha1b)
      This canonicalizes sha1s before comparing them.
      static java.lang.String hexSha1OfBytes​(byte[] data)
      Returns the SHA-1 of the given bytes, as a hex string.
      static java.lang.String hexSha1OfInputStream​(java.io.InputStream in)
      Returns the SHA-1 of the given input stream, as a hex string.
    • Method Detail

      • createSha1MessageDigest

        static java.security.MessageDigest createSha1MessageDigest()
        Returns a SHA-1 MessageDigest, which we expect to always be available.
      • binarySha1OfBytes

        static byte[] binarySha1OfBytes​(byte[] data)
        Returns the SHA-1 of the given bytes, as binary data.
      • hexSha1OfBytes

        static java.lang.String hexSha1OfBytes​(byte[] data)
        Returns the SHA-1 of the given bytes, as a hex string.
      • hexSha1OfInputStream

        static java.lang.String hexSha1OfInputStream​(java.io.InputStream in)
                                              throws java.io.IOException
        Returns the SHA-1 of the given input stream, as a hex string.
        Throws:
        java.io.IOException
      • binarySha1OfInputStream

        static byte[] binarySha1OfInputStream​(java.io.InputStream in)
                                       throws java.io.IOException
        Returns the SHA-1 of the given InputStream, as binary data.
        Throws:
        java.io.IOException
      • equalHexSha1s

        static boolean equalHexSha1s​(java.lang.String sha1a,
                                     java.lang.String sha1b)
        This canonicalizes sha1s before comparing them.
        Parameters:
        sha1a - the first sha1 to compare. must be non-null.
        sha1b - the second sha1 to compare. must be non-null.
        Returns:
        true iff these represent the same sha1.