mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
22 lines
481 B
C#
22 lines
481 B
C#
using System.Security.Cryptography;
|
|
using System.Text;
|
|
|
|
namespace Kruzya.TelegramBot.Core.Service
|
|
{
|
|
public class Hash
|
|
{
|
|
public string GenerateHash(string input)
|
|
{
|
|
var output = string.Empty;
|
|
var hashedBytes = SHA256.HashData(Encoding.UTF8.GetBytes(input));
|
|
|
|
foreach (var b in hashedBytes)
|
|
{
|
|
output += string.Format("{0,2:x2}", b);
|
|
}
|
|
|
|
return output;
|
|
}
|
|
}
|
|
}
|