feat: added support to get item durability
This commit is contained in:
27
Plugin/Utils/HashingUtils.cs
Normal file
27
Plugin/Utils/HashingUtils.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LootValueEX.Utils
|
||||
{
|
||||
internal class HashingUtils
|
||||
{
|
||||
internal static string ConvertToSha256(string value)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
using (var hash = SHA256.Create())
|
||||
{
|
||||
Encoding encoding = Encoding.UTF8;
|
||||
byte[] result = hash.ComputeHash(encoding.GetBytes(value));
|
||||
foreach (byte b in result)
|
||||
{
|
||||
sb.Append(b.ToString("x2"));
|
||||
}
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user