getting there

This commit is contained in:
2026-02-20 12:23:23 +01:00
parent 5801b29f22
commit 7beadabb47
12 changed files with 214 additions and 56 deletions

View File

@@ -0,0 +1,20 @@
using System.Buffers.Text;
using System.Text;
namespace PVHelpers
{
public static class Base64Helpers
{
public static String EncodeBase64String(this Byte[] data)
{
Byte[] buf = new Byte[data.Length * 2];
if (Base64.EncodeToUtf8(data, buf, out _, out Int32 written) == System.Buffers.OperationStatus.Done)
{
return Encoding.UTF8.GetString(buf, 0, written);
} else
{
throw new Exception("Shit went south");
}
}
}
}