static void Main(string[] args) { Console.WriteLine(RandomHelper.GenerateBase64(16)); Console.WriteLine(RandomHelper2.GenerateBase64s()); Console.WriteLine("Press [Enter] key to exit."); Console.ReadLine(); }
public void ToBase64_Random() { void Test(int bytesLength) { var bytes = RandomHelper2.GenerateBytes(bytesLength); var text = Convert.ToBase64String(bytes); Console.WriteLine(text); Assert.AreEqual(text, bytes.ToBase64()); CollectionAssert.AreEqual(bytes, text.FromBase64()); } for (var i = 1; i <= 64; i++) { Test(i); } }