Converts a BASE64-encoded string to an equivalent 8-bit unsigned integer array. - CSharp System

CSharp examples for System:String Base64

Description

Converts a BASE64-encoded string to an equivalent 8-bit unsigned integer array.

Demo Code


using System.Text.RegularExpressions;
using System.Text;
using System.Net;
using System.Linq;
using System.Globalization;
using System.Collections.Generic;
using System;/*w  ww  . j  a v a  2s  . co m*/

public class Main{
        /// <summary>
    ///   <para>Converts a BASE64-encoded string to an equivalent 8-bit unsigned integer array.</para>
    /// </summary>
    /// <param name="self">BASE64-encoded string to be converted to binary form.</param>
    /// <returns>An array of 8-bit unsigned integers that is equivalent to <paramref name="self"/>.</returns>
    /// <exception cref="ArgumentNullException">If <paramref name="self"/> is a <c>null</c> reference.</exception>
    /// <seealso cref="System.Convert.FromBase64String(string)"/>
    public static byte[] Base64(this string self)
    {
      Assertion.NotNull(self);

      return System.Convert.FromBase64String(self);
    }
}

Related Tutorials