Upload new LibZNI

This commit is contained in:
Zontreck 2020-09-10 09:29:51 -07:00
parent 3ab400b0d0
commit c5aac5438b
2 changed files with 23 additions and 2 deletions

View file

@ -1,9 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
[assembly: LibZNI.AutoUpdater("/job/Bot", "!os!.tar")]
namespace LibZNI
{
public class Tools
@ -14,6 +16,19 @@ namespace LibZNI
return int.Parse(DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString());
}
public static string GetOSShortID()
{
bool isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
bool isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
bool isMac = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
if (isWindows) return "windows";
if (isLinux) return "linux";
if (isMac) return "osx";
return "unknown";
}
public static string Hash2String(byte[] Hash)
{
StringBuilder sb = new StringBuilder();