MD5 работает через раз? - C#

Узнай цену своей работы

Формулировка задачи:

  public static string Generate_Sig(string postDataQuery)
        {
            var array = postDataQuery.Split('&');
            Array.Sort(array);
            return CryptographyHelper.GetMd5Hash(string.Join("", array) + api.GetSecretKey, Encoding.UTF8);
        }
Скажите пожалуйста, почему мд5 работает через раз ?

Решение задачи: «MD5 работает через раз?»

textual
Листинг программы
static MD5 hasher = MD5.Create();
 
static string GetMD5(string text)
{
    byte[] hash = hasher.ComputeHash(Encoding.UTF8.GetBytes(text));
 
    return string.Concat(hash.Select(b => b.ToString("x2")));//BitConverter.ToString(hash).Replace("-", "");
}

Оцени полезность:

7   голосов , оценка 4 из 5
Похожие ответы