2014-11-30 15 views

risposta

12

Utilizzare MD5.Create() dal pacchetto System.Security.Cryptography.Hashing.Algorithms . System.Security.Cryptography.Algorithms.

Aggiornamento System.Security.Cryptography.Hashing.Algorithms è contrassegnato obsoleto al momento.

+0

Ciao, v'è un'implementazione di System.Security.Cryptography.ICryptoTransform per MD5 in nucleo dotnet da utilizzare con il CryptoStream? Vorrei leggere un flusso e scrivere su più flussi, compresi i flussi hash incrementali calcolati ... – Dede

+0

Trovato: System.Security.Cryptography.IncrementalHash.Create (HashAlgorithmName.MD5) – Dede

6

Aggiornamento a Victor Hurdugaci's answer: utilizzare il pacchetto System.Security.Cryptography.Algorithms.

System.Security.Cryptography.Hashing.Algorithms è contrassegnato come obsoleto al momento.

hint

5

Per hash incrementale, in System.Security.Cryptography:

using (IncrementalHash hasher = IncrementalHash.CreateHash(HashAlgorithmName.MD5)) 
{ 
    //hash loop 
    hasher.AppendData(data); 
    hasher.AppendData(data); 
    hasher.AppendData(data); 


    byte[] hash = hasher.GetHashAndReset(); 
} 
Problemi correlati