public static T[] Shuffle <T>(this T[] source, int index, int length) { T[] sorted = new T[source.Length]; byte[] randoms = new byte[sorted.Length]; source.CopyTo(sorted, 0); RandomImpl.NextBytes(randoms); Array.Sort(randoms, sorted, index, length); return(sorted); }
public static void RandomBytes(byte[] buffer) { RandomImpl.NextBytes(buffer); }