Alternatives to MD5CryptoServiceProvider in CoreCLR (ASP.NET 5 Core)

I am using the new version of ASP.NET MVC 6 (ASP.NET 5). If I am targeting the .NET CoreCLR platform (ASP.NET Core), the code does not compile because I use MD5CryptoServiceProvider from System.Security.Cryptography . Can you suggest any alternatives that compile with the CoreCLR framework?

+8
asp.net-core .net-core
source share
3 answers

Use MD5.Create() from the System.Security.Cryptography.Hashing.Algorithms package. System.Security.Cryptography.Algorithms .

The System.Security.Cryptography.Hashing.Algorithms update is currently marked as deprecated.

+12
source share

Refresh Victor Khurdugachi's answer : use the System.Security.Cryptography.Algorithms package.

System.Security.Cryptography.Hashing.Algorithms is currently marked as deprecated.

hint

+6
source share

For incremental hash 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(); } 
+5
source share

All Articles