alielie
2025-10-10 15bbd62b0b24b72c717ae91ab45348a2083ad04e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
using System.Security.Cryptography;
using System.Text;
 
namespace Plugin.SNGenerateTool
{
    internal class HashPlus
    {
        public static string GetHashSHA256(string text)
        {
            byte[] bytes = Encoding.Unicode.GetBytes(text);
            using (SHA256Managed sHA256Managed = new SHA256Managed())
            {
                byte[] array = sHA256Managed.ComputeHash(bytes);
                string text2 = string.Empty;
                byte[] array2 = array;
                foreach (byte b in array2)
                {
                    text2 += $"{b:x2}";
                }
                return text2;
            }
        }
 
        public static string GetHashSHA512(string text)
        {
            byte[] bytes = Encoding.Unicode.GetBytes(text);
            using (SHA512Managed sHA512Managed = new SHA512Managed())
            {
                byte[] array = sHA512Managed.ComputeHash(bytes);
                string text2 = string.Empty;
                byte[] array2 = array;
                foreach (byte b in array2)
                {
                    text2 += $"{b:x2}";
                }
                return text2;
            }
        }
 
        public static string GetHashSHA384(string text)
        {
            byte[] bytes = Encoding.Unicode.GetBytes(text);
            using (SHA384Managed sHA384Managed = new SHA384Managed())
            {
                byte[] array = sHA384Managed.ComputeHash(bytes);
                string text2 = string.Empty;
                byte[] array2 = array;
                foreach (byte b in array2)
                {
                    text2 += $"{b:x2}";
                }
                return text2;
            }
        }
 
        public static string GetHashSHA1(string text)
        {
            byte[] bytes = Encoding.Unicode.GetBytes(text);
            using (SHA1Managed sHA1Managed = new SHA1Managed())
            {
                byte[] array = sHA1Managed.ComputeHash(bytes);
                string text2 = string.Empty;
                byte[] array2 = array;
                foreach (byte b in array2)
                {
                    text2 += $"{b:x2}";
                }
                return text2;
            }
        }
 
        public static string GetHashMD5(string text)
        {
            byte[] bytes = Encoding.Unicode.GetBytes(text);
            using (MD5 mD = MD5.Create())
            {
                byte[] array = mD.ComputeHash(bytes);
                string text2 = string.Empty;
                byte[] array2 = array;
                foreach (byte b in array2)
                {
                    text2 += $"{b:x2}";
                }
                return text2;
            }
        }
    }
 
}