aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Common/Compute.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/slskd/Common/Compute.cs')
-rw-r--r--src/slskd/Common/Compute.cs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/slskd/Common/Compute.cs b/src/slskd/Common/Compute.cs
index 8d7c1ceb..d235a87c 100644
--- a/src/slskd/Common/Compute.cs
+++ b/src/slskd/Common/Compute.cs
@@ -33,6 +33,7 @@
namespace slskd
{
using System;
+ using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
@@ -64,5 +65,15 @@ namespace slskd
using var sha256 = SHA256.Create();
return BitConverter.ToString(sha256.ComputeHash(Encoding.UTF8.GetBytes(str))).Replace("-", string.Empty);
}
+
+ public static OperatingSystem OperatingSystem()
+ {
+ if (System.OperatingSystem.IsWindows())
+ {
+ return slskd.OperatingSystem.Windows;
+ }
+
+ return slskd.OperatingSystem.Linux;
+ }
}
} \ No newline at end of file