Exemple #1
0
 /// <summary>
 /// Expand 32 bit seed to 64 bit deterministically, ensuring there are bits set in the upper part
 /// </summary>
 public static ulong ExpandSeed(uint seed)
 {
     unchecked
     {
         ulong upper = (ulong)HashUtil.XorFold64To32(seed * 7199369) << 32;
         return(((ulong)seed | upper) ^ 0b11100000_01111101_01000011_11110110_01001111_10100000_01100000_10011011UL);
     }
 }
Exemple #2
0
        static RandomSeed()
        {
            s_seedIncrement = 997;

            int sysSeed = (int)HashUtil.XorFold64To32((ulong)Stopwatch.GetTimestamp() ^ (ulong)Environment.TickCount);

            s_systemRandom = new Random(sysSeed);
        }
Exemple #3
0
 public static uint Hash32(ulong one, ulong two)
 {
     return(HashUtil.XorFold64To32(Hash64(one, two)));
 }
Exemple #4
0
 public static uint Hash32(float x, float y)
 {
     return(HashUtil.XorFold64To32(Hash64(x, y)));
 }