Packages

trait HashBuilder extends AnyRef

The methods of HashBuilder change its internal state and return this for convenience.

Requirements for all implementations:

For any HashBuilder hb, it is computationally infeasible to find two sequences as1 and as2 of calls to add such that the concatenation of as1 differs from the concatenation as2, yet their computed hashes are the same, i.e., as1.foldLeft(hb)((hb, a) => hb.add(a)).finish is the same as as2.foldLeft(hb)((hb, a) => hb.add(a)).finish.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HashBuilder
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def addWithoutLengthPrefix(a: ByteString): HashBuilder.this.type

    Appends a com.google.protobuf.ByteString a to the sequence of bytes to be hashed.

    Appends a com.google.protobuf.ByteString a to the sequence of bytes to be hashed. Use add for com.google.protobuf.ByteStrings of variable length to prevent hash collisions due to concatenation of variable-length strings.

    Document at the call site in production code why it is not necessary to include a length prefix.

    returns

    the updated hash builder

    Exceptions thrown

    java.lang.IllegalStateException if the finish method has already been called on this HashBuilder

  2. abstract def finish(): Hash

    Terminates the building of the hash.

    Terminates the building of the hash. No more additions can be made using HashBuilder.addWithoutLengthPrefix after this method has been called.

    returns

    The hash of the array accumulated so far.

    Exceptions thrown

    java.lang.IllegalStateException if finish had been called before on this HashBuilder

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def add(a: Long): HashBuilder.this.type

    Shorthand for addWithoutLengthPrefix(DeterministicEncoding.encodeLong(a))

  5. def add(a: Int): HashBuilder.this.type

    Shorthand for addWithoutLengthPrefix(DeterministicEncoding.encodeInt(a))

  6. def add(a: String): HashBuilder.this.type

    Shorthand for add(ByteString.copyFromUtf8(a))

  7. def add(a: ByteString): HashBuilder.this.type

    Appends the length of a (encoded as fixed length com.google.protobuf.ByteString) as well as a to this builder.

    Appends the length of a (encoded as fixed length com.google.protobuf.ByteString) as well as a to this builder.

    returns

    the updated hash builder

    Exceptions thrown

    java.lang.IllegalStateException if the finish method has already been called on this HashBuilder

  8. def addWithoutLengthPrefix(a: String): HashBuilder.this.type

    Shorthand for addWithoutLengthPrefix(ByteString.copyFromUtf8(a)) Use add for strings of variable length to prevent hash collisions due to concatenation of variable-length strings.

    Shorthand for addWithoutLengthPrefix(ByteString.copyFromUtf8(a)) Use add for strings of variable length to prevent hash collisions due to concatenation of variable-length strings.

    Document at the call site in production code why it is not necessary to include a length prefix.

  9. def addWithoutLengthPrefix(a: Array[Byte]): HashBuilder.this.type

    Shorthand for addWithoutLengthPrefix(ByteString.copyFrom(a))

  10. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  11. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  20. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  21. def toString(): String
    Definition Classes
    AnyRef → Any
  22. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  23. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped