Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
HashHelpers.cs
Go to the documentation of this file.
2
3namespace System.Collections;
4
5internal static class HashHelpers
6{
7 public static ulong GetFastModMultiplier(uint divisor)
8 {
9 return ulong.MaxValue / (ulong)divisor + 1;
10 }
11
12 [MethodImpl(MethodImplOptions.AggressiveInlining)]
13 public static uint FastMod(uint value, uint divisor, ulong multiplier)
14 {
15 return (uint)(((multiplier * value >> 32) + 1) * divisor >> 32);
16 }
17}
static uint FastMod(uint value, uint divisor, ulong multiplier)
static ulong GetFastModMultiplier(uint divisor)
Definition HashHelpers.cs:7