mirror of
https://github.com/proxysu/ProxySU.git
synced 2024-11-25 22:56:09 +03:00
24 lines
663 B
C#
24 lines
663 B
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace ProxySuper.Core.Services
|
|||
|
{
|
|||
|
public class Base64
|
|||
|
{
|
|||
|
public static string Encode(string plainText)
|
|||
|
{
|
|||
|
var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText);
|
|||
|
return System.Convert.ToBase64String(plainTextBytes);
|
|||
|
}
|
|||
|
|
|||
|
public static string Decode(string base64EncodedData)
|
|||
|
{
|
|||
|
var base64EncodedBytes = System.Convert.FromBase64String(base64EncodedData);
|
|||
|
return System.Text.Encoding.UTF8.GetString(base64EncodedBytes);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|