using System.Text;
public static class Base64Converter
{
static public string EncodeTo64(string toEncode)
{
byte[] toEncodeAsBytes= ASCIIEncoding.ASCII.GetBytes(toEncode);
return Convert.ToBase64String(toEncodeAsBytes);
}
static public string DecodeFrom64(string encodedData)
{byte[] encodedDataAsBytes = Convert.FromBase64String(encodedData);
return ASCIIEncoding.ASCII.GetString(encodedDataAsBytes);
}
}
Comments
Post a Comment