123456789101112131415161718192021222324 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Security.Cryptography;
- using System.Text;
- using System.Threading.Tasks;
-
- namespace ProRestaurant.Classes
- {
- public class CommonFunctions
- {
- public static string GetHashSHA256(string text)
- {
- SHA256Managed crypt = new SHA256Managed();
- string hash = string.Empty;
- byte[] crypto = crypt.ComputeHash(Encoding.UTF8.GetBytes(text), 0, Encoding.UTF8.GetByteCount(text));
- foreach (byte bit in crypto)
- {
- hash += bit.ToString("x2");
- }
- return hash;
- }
- }
- }
|