38 references to HashHelpers
System.Private.CoreLib (38)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (13)
190HashHelpers.SerializationInfoTable.Add(this, info); 490int size = HashHelpers.GetPrime(capacity); 497_fastModMultiplier = HashHelpers.GetFastModMultiplier((uint)size); 628if (!typeof(TKey).IsValueType && collisionCount > HashHelpers.HashCollisionThreshold && comparer is NonRandomizedStringEqualityComparer) 1038if (!typeof(TKey).IsValueType && collisionCount > HashHelpers.HashCollisionThreshold && comparer is NonRandomizedStringEqualityComparer) 1175if (!typeof(TKey).IsValueType && collisionCount > HashHelpers.HashCollisionThreshold && comparer is NonRandomizedStringEqualityComparer) 1201HashHelpers.SerializationInfoTable.TryGetValue(this, out SerializationInfo? siInfo); 1242HashHelpers.SerializationInfoTable.Remove(this); 1245private void Resize() => Resize(HashHelpers.ExpandPrime(_count), false); 1276_fastModMultiplier = HashHelpers.GetFastModMultiplier((uint)newSize); 1556int newSize = HashHelpers.GetPrime(capacity); 1590int newSize = HashHelpers.GetPrime(capacity); 1746return ref buckets[HashHelpers.FastMod(hashCode, (uint)buckets.Length, _fastModMultiplier)];
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (14)
142HashHelpers.SerializationInfoTable.Add(this, info); 159int threshold = HashHelpers.ExpandPrime(source.Count + 1); 286return ref buckets[HashHelpers.FastMod((uint)hashCode, (uint)buckets.Length, _fastModMultiplier)]; 528if (!typeof(T).IsValueType && collisionCount > HashHelpers.HashCollisionThreshold && comparer is NonRandomizedStringEqualityComparer) 722HashHelpers.SerializationInfoTable.TryGetValue(this, out SerializationInfo? siInfo); 741_fastModMultiplier = HashHelpers.GetFastModMultiplier((uint)capacity); 762HashHelpers.SerializationInfoTable.Remove(this); 1279int newSize = HashHelpers.GetPrime(capacity); 1284private void Resize() => Resize(HashHelpers.ExpandPrime(_count), forceNewHashCodes: false); 1316_fastModMultiplier = HashHelpers.GetFastModMultiplier((uint)newSize); 1348int newSize = HashHelpers.GetPrime(capacity); 1392int size = HashHelpers.GetPrime(capacity); 1401_fastModMultiplier = HashHelpers.GetFastModMultiplier((uint)size); 1511if (!typeof(T).IsValueType && collisionCount > HashHelpers.HashCollisionThreshold && comparer is NonRandomizedStringEqualityComparer)
src\libraries\System.Private.CoreLib\src\System\Collections\Hashtable.cs (7)
275int hashsize = (rawsize > InitialSize) ? HashHelpers.GetPrime((int)rawsize) : InitialSize; 374HashHelpers.SerializationInfoTable.Add(this, info); 408incr = (uint)(1 + ((seed * HashHelpers.HashPrime) % ((uint)hashsize - 1))); 694int rawsize = HashHelpers.ExpandPrime(_buckets.Length); 943uint incr = unchecked((uint)(1 + ((seed * HashHelpers.HashPrime) % ((uint)newBuckets.Length - 1)))); 1093HashHelpers.SerializationInfoTable.TryGetValue(this, out SerializationInfo? siInfo); 1175HashHelpers.SerializationInfoTable.Remove(this);
src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticMapState.cs (3)
133int modulus = HashHelpers.GetPrime(values.Length); 150modulus = HashHelpers.GetPrime(values.Length); 162modulus = HashHelpers.GetPrime(modulus + 1);
src\System\RuntimeType.CoreCLR.cs (1)
4373size = HashHelpers.GetPrime(size);