Class HashCodeCollider$

java.lang.Object
org.apache.pekko.http.HashCodeCollider$

public class HashCodeCollider$ extends Object
Helper that creates strings that all share the same hashCode == 0.

Adapted from MIT-licensed code by Andriy Plokhotnyuk at https://github.com/plokhotnyuk/jsoniter-scala/blob/26b5ecdd4f8c2ab7e97bd8106cefdda4c1e701ce/jsoniter-scala-benchmark/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/macros/HashCodeCollider.scala#L6.

  • Field Details

    • MODULE$

      public static final HashCodeCollider$ MODULE$
      Static reference to the singleton instance of this Scala object.
  • Constructor Details

    • HashCodeCollider$

      public HashCodeCollider$()
  • Method Details

    • visibleChars

      public scala.collection.immutable.IndexedSeq<Object> visibleChars()
    • asciiChars

      public scala.collection.Iterator<Object> asciiChars()
    • asciiCharsAndHash

      public scala.collection.Iterator<scala.Tuple2<Object,Object>> asciiCharsAndHash(int previousHash)
    • zeroHashCodeIterator

      public scala.collection.Iterator<String> zeroHashCodeIterator()
      Creates an iterator of Strings that all have hashCode == 0