2023-05-23 10:52:39 +00:00
|
|
|
namespace NzbDrone.Core.Download.Clients.FreeboxDownload
|
2022-12-17 02:37:21 +00:00
|
|
|
{
|
|
|
|
public static class EncodingForBase64
|
|
|
|
{
|
|
|
|
public static string EncodeBase64(this string text)
|
|
|
|
{
|
|
|
|
if (text == null)
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-05-23 10:52:39 +00:00
|
|
|
var textAsBytes = System.Text.Encoding.UTF8.GetBytes(text);
|
2022-12-17 02:37:21 +00:00
|
|
|
return System.Convert.ToBase64String(textAsBytes);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static string DecodeBase64(this string encodedText)
|
|
|
|
{
|
|
|
|
if (encodedText == null)
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-05-23 10:52:39 +00:00
|
|
|
var textAsBytes = System.Convert.FromBase64String(encodedText);
|
2022-12-17 02:37:21 +00:00
|
|
|
return System.Text.Encoding.UTF8.GetString(textAsBytes);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|