FullAOT fallback: Slightly better random
authorMiguel de Icaza <miguel@gnome.org>
Thu, 1 Aug 2013 13:50:20 +0000 (09:50 -0400)
committerMiguel de Icaza <miguel@gnome.org>
Thu, 1 Aug 2013 13:50:20 +0000 (09:50 -0400)
mcs/class/corlib/System/Guid.cs

index 0e8b51a1c173dd442466784769872c0ff3b1fc41..cc461c2913981cd117b8507ada4ec01794ec6c08 100644 (file)
@@ -473,16 +473,11 @@ namespace System {
 #endif
 
 #if FULL_AOT_RUNTIME && !MONOTOUCH
-
                // NSA approved random generator.
                static void LameRandom (byte [] b)
                {
-                       l = DateTime.UtcNow.Ticks;
-
-                       for (int i = 0; i < b.Length; i++){
-                               b [i] = (byte)l;
-                               l++;
-                       }
+                       var r = new Random ();
+                       r.NextBytes (b);
                }
 #endif