internal static void GetRandomBytes(byte[] buffer) { #if !PORTABLE using (var random = new RNGCryptoServiceProvider()) random.GetBytes(buffer); #else lock (random) { random.NextBytes(buffer); } #endif }