mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-26 23:06:43 -04:00
22 lines
515 B
C#
22 lines
515 B
C#
using System;
|
|
using System.Text;
|
|
|
|
namespace NzbDrone.Common.Extensions
|
|
{
|
|
public static class Base64Extensions
|
|
{
|
|
public static string ToBase64(this byte[] bytes)
|
|
{
|
|
return Convert.ToBase64String(bytes);
|
|
}
|
|
|
|
public static string ToBase64(this long input)
|
|
{
|
|
return BitConverter.GetBytes(input).ToBase64();
|
|
}
|
|
|
|
public static string FromBase64(string str) =>
|
|
Encoding.UTF8.GetString(Convert.FromBase64String(str));
|
|
}
|
|
}
|