Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on May 24th, 2012  |  syntax: C#  |  size: 0.76 KB  |  views: 232  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.         public static uint CalculateSeedGen3(DateTime time)
  2.         {
  3.             DateTime start;
  4.             if (time.Year <= 1999)
  5.                 start = new DateTime(1900, 12, 31);
  6.             else if (time.Year == 2000)
  7.                 start = new DateTime(1999, 12, 31);
  8.             //year 2001 or later
  9.             else
  10.                 start = new DateTime(2000, 12, 31);
  11.             TimeSpan span = time - start;
  12.             var d = (uint)span.TotalDays;
  13.             var h = (uint)time.Hour;
  14.             var m = (uint)time.Minute;
  15.  
  16.             uint v = 1440 * d + 960 * (h / 10) + 60 * (h % 10) + 16 * (m / 10) + m % 10;
  17.             var x = (uint)Math.Floor((double)v / 65536);
  18.             uint y = v % 65536;
  19.  
  20.             return x ^ y;
  21.         }