feat: added getmd5hash func into TheManager
Signed-off-by: limited_dev <loginakkisativ@gmail.com>
This commit is contained in:
parent
e735d94e63
commit
56e144e8ab
1 changed files with 12 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
using System.Security.Cryptography;
|
||||||
using ImageBoardServerApp.Data;
|
using ImageBoardServerApp.Data;
|
||||||
using ImageBoardServerApp.Data.Repository;
|
using ImageBoardServerApp.Data.Repository;
|
||||||
|
|
||||||
|
@ -93,4 +94,15 @@ public class TheManager
|
||||||
{
|
{
|
||||||
return await CommentsRepository.getCommentByGETAsync(board, GET) != null;
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue