crypto attempts

This commit is contained in:
raphaeIl
2025-01-11 02:24:07 -05:00
parent 55c3fc1fec
commit 0b12a29289
18 changed files with 6810 additions and 41 deletions

View File

@@ -1,4 +1,5 @@
using System;
using Google.Protobuf.Reflection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -8,6 +9,31 @@ namespace Novaria.Common.Utils
{
public static class Utils
{
public static void SaveFileDescriptorProtoToFile(FileDescriptorProto fileDescriptorProto, string outputDirectory)
{
if (fileDescriptorProto == null)
{
throw new ArgumentNullException(nameof(fileDescriptorProto));
}
if (string.IsNullOrEmpty(outputDirectory))
{
throw new ArgumentException("Output directory cannot be null or empty", nameof(outputDirectory));
}
string protoName = fileDescriptorProto.Name ?? "unknown.proto";
string protoContent = fileDescriptorProto.ToString();
string outputPath = Path.Combine(outputDirectory, protoName);
Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
File.WriteAllText(outputPath, protoContent);
Console.WriteLine($"Saved {protoName} to {outputPath}");
}
public static void PrintByteArray(byte[] byteArray)
{
if (byteArray == null || byteArray.Length == 0)