feat: added getmd5hash func into TheManager

Signed-off-by: limited_dev <loginakkisativ@gmail.com>
This commit is contained in:
limited_dev 2023-06-08 23:31:17 +02:00
parent e735d94e63
commit 56e144e8ab

View file

@ -1,3 +1,4 @@
using System.Security.Cryptography;
using ImageBoardServerApp.Data;
using ImageBoardServerApp.Data.Repository;
@ -93,4 +94,15 @@ public class TheManager
{
return await CommentsRepository.getCommentByGETAsync(board, GET) != null;
}
public static string getmd5Hash()
{
var bytes = new byte[16];
using (var rng = new RNGCryptoServiceProvider())
{
rng.GetBytes(bytes);
}
return BitConverter.ToString(bytes).Replace("-", "").ToLower();
}
}