Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

HashAlgorithm : System.PlatformNotSupportedException error

$
0
0

Dear all, 

I am trying to work in the .net core 2 application, and trying to generate the HashAlgorithm object with SHA512

The code is getting created without any errors, but at the runtime i am getting the error stating "Operation is not supported on this platform"

The code that i m trying is as under :

           Console.WriteLine("Get String Value");

            string TestStr = Console.ReadLine();

            HashAlgorithm hash = HashAlgorithm.Create("SHA512");

            Console.WriteLine("Hash Value for the input String is ");

            Console.WriteLine( Convert.ToBase64String(hash.ComputeHash(ASCIIEncoding.ASCII.GetBytes( TestStr  ))));

            Console.ReadLine();

Kindly let me know what can be work around for the above code. 

Regards. 

Abhinav Aggarwal


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>