Class Sha1HashCode

  • public final class Sha1HashCode
    extends Object
    A typesafe representation of a SHA-1 hash. It is safer to pass this around than a byte[].
    • Method Detail

      • fromBytes

        public static Sha1HashCode fromBytes​(byte[] bytes)
        Clones the specified bytes and uses the clone to create a new Sha1HashCode.
      • fromHashCode

        public static Sha1HashCode fromHashCode​( hashCode)
      • update

        public update​( hasher)
        Updates the specified Hasher by putting the 20 bytes of this SHA-1 to it in order.
        The specified Hasher.
      • asHashCode

        public asHashCode()
        This method should be used sparingly as we are trying to favor Sha1HashCode over HashCode, where appropriate. Currently, the FileHashCache API is written in terms of HashCode, so conversions are common. As we migrate it to use Sha1HashCode, this method should become unnecessary.
        a HashCode with an equivalent value
      • getHash

        public String getHash()
        the hash as a 40-character string from the alphabet [a-f0-9].
      • hashCode

        public int hashCode()
        hashCode in class Object