Exemple #1
0
 static void Main(string[] args)
 {
     Console.WriteLine(RandomHelper.GenerateBase64(16));
     Console.WriteLine(RandomHelper2.GenerateBase64s());
     Console.WriteLine("Press [Enter] key to exit.");
     Console.ReadLine();
 }
Exemple #2
0
        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);
            }
        }