Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sn4k3/UVtools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'PrusaSL1Reader/Helpers.cs')
-rw-r--r--PrusaSL1Reader/Helpers.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/PrusaSL1Reader/Helpers.cs b/PrusaSL1Reader/Helpers.cs
index f2f9396..22decff 100644
--- a/PrusaSL1Reader/Helpers.cs
+++ b/PrusaSL1Reader/Helpers.cs
@@ -6,7 +6,9 @@
* of this license document, but changing it is not allowed.
*/
+using System;
using System.IO;
+using System.Security.Cryptography;
using BinarySerialization;
using SixLabors.ImageSharp.Formats.Png;
using SixLabors.ImageSharp.PixelFormats;
@@ -86,5 +88,11 @@ namespace PrusaSL1Reader
return WriteFileStream(fs, stream);
}
}
+
+ public static SHA1CryptoServiceProvider SHA1 { get; } = new SHA1CryptoServiceProvider();
+ public static string ComputeSHA1Hash(byte[] input)
+ {
+ return Convert.ToBase64String(SHA1.ComputeHash(input));
+ }
}
}