public class SHAHASH
{
public static string GetShaHashXXX(string Password, int t)
{
List<string> codes = new List<string>();
string current = Password;
string next = string.Empty;
string R = string.Empty;
for (int i = 0; i <= t; i++)
{
codes.Add(next);
next = getHashSha256(current);
current = next;
}
foreach (string code in codes) { R += code; }
//Parallel.ForEach(codes, (code) => { R += code; });
return R;
}
private static string getHashSha256(string text)
{
byte[] bytes = Encoding.Unicode.GetBytes(text);
using (System.Security.Cryptography.SHA256Managed hashstring = new System.Security.Cryptography.SHA256Managed())
C# HASH算法生成字符串
最新推荐文章于 2024-03-15 19:00:04 发布