public static SHA1 ( string input ) : string | ||
input | string | |
Résultat | string |
public static string SHA1(string input)
{
SHA1CryptoServiceProvider sha = new SHA1CryptoServiceProvider();
string salt = input[input[0] % input.Length] + "B4TH5ALTS" + input.Length;
byte[] inputBytes = Encoding.UTF8.GetBytes(input + salt);
byte[] hashedBytes = sha.ComputeHash(inputBytes);
return BitConverter.ToString(hashedBytes).Replace("-", "");
}