- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
public static bool EqualHash(string x, string y)
{
if ((x == null || y == null) && x != y)
return false;
if (x == null && x == y)
return true;
if (x.Length != y.Length)
return false;
for (int i=0; i<x.Length; i++)
{
if (x[i] == y[i])
return false;
}
return true;
}
//чуть ниже в том же классе
public static bool SimpleEqualHash(string x, string y)
{
return (x == y);
}
public static class HASH
{
public static string Hash(string key)
{
SHA384Managed aSHA384 = new SHA384Managed();
byte[] newHash = aSHA384.ComputeHash(Encoding.Unicode.Get Bytes(key));
return Encoding.Unicode.GetString(newHash);
}
public static bool EqualHash(string x, string y)
//....
public static bool SimpleEqualHash(string x, string y)
//....
}