Esempio n. 1
0
        private static void Enc()
        {
            List <string> rawStrings = new List <string>
            {
                "",
                "f",
                "fo",
                "foo",
                "foob",
                "fooba",
                "foobar",
            };

            foreach (string rawString in rawStrings)
            {
                byte[] b       = Encoding.UTF8.GetBytes(rawString);
                string encoded = MyBase64.Encode(b);
                Console.WriteLine(encoded);
            }
        }
Esempio n. 2
0
        private static void Dec()
        {
            List <string> encodedStrings = new List <string>
            {
                "",
                "Zg==",
                "Zm8=",
                "Zm9v",
                "Zm9vYg==",
                "Zm9vYmE=",
                "Zm9vYmFy",
            };

            foreach (string ex in encodedStrings)
            {
                byte[] b = MyBase64.Decode(ex);

                string s = Encoding.UTF8.GetString(b);
                Console.WriteLine(s);
            }
        }