Class Fingerprint


  • public class Fingerprint
    extends java.lang.Object
    Basic 20 byte finger print class.
    • Constructor Summary

      Constructors 
      Constructor Description
      Fingerprint​(byte[] source)
      Base constructor (160 bits).
      Fingerprint​(byte[] source, int bitLength)
      Constructor with length - produces bitLength bits.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] calculateFingerprint​(byte[] input)
      Return a byte array containing a calculated fingerprint for the passed in input data.
      static byte[] calculateFingerprint​(byte[] input, int bitLength)
      Return a byte array containing a calculated fingerprint for the passed in input data.
      boolean equals​(java.lang.Object o)  
      byte[] getFingerprint()  
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Fingerprint

        public Fingerprint​(byte[] source)
        Base constructor (160 bits).
        Parameters:
        source - original data to calculate the fingerprint from.
      • Fingerprint

        public Fingerprint​(byte[] source,
                           int bitLength)
        Constructor with length - produces bitLength bits.
        Parameters:
        source - original data to calculate the fingerprint from.
    • Method Detail

      • getFingerprint

        public byte[] getFingerprint()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • calculateFingerprint

        public static byte[] calculateFingerprint​(byte[] input)
        Return a byte array containing a calculated fingerprint for the passed in input data. This calculation is compatible with the BC FIPS API.
        Parameters:
        input - data to base the fingerprint on.
        Returns:
        a byte array containing a 160 bit fingerprint.
      • calculateFingerprint

        public static byte[] calculateFingerprint​(byte[] input,
                                                  int bitLength)
        Return a byte array containing a calculated fingerprint for the passed in input data. This calculation is compatible with the BC FIPS API.
        Parameters:
        input - data to base the fingerprint on.
        bitLength - bit length of finger print to be produced.
        Returns:
        a byte array containing a 20 byte fingerprint.