Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4173

How can I use MD5 in Blazor WASM when it is deprecated?

$
0
0

In a .NET 8 console app, this code works:

using var hasher = MD5.Create();var bytes = Encoding.UTF8.GetBytes("Hello world!");var hashBytes = hasher.ComputeHash(bytes);var hashHex = Convert.ToHexString(hashBytes);Console.WriteLine(hashHex);// Prints: 86FB269D190D2C85F6E0468CECA42A20

In Blazor WASM I get this error:

Error: One or more errors occurred. ('MD5' is not a known hash algorithm)

I found out MD5 is not recommended anymore but it is still used by the software library I need to work with. Any ideas? I am open to a Javascript MD5 library if required.


Viewing all articles
Browse latest Browse all 4173


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