Which one to use: Managed vs. NonManaged hashing algorithms

后端 未结 6 1820
离开以前
离开以前 2021-01-01 14:03

In a regular C# application which class to use for hashing: xxxManaged or xxx (i.e SHA1Managed vs SHA1) and why?

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-01 14:39

    Managed library is safer to use and does not incur the PInvoke overhead. Also for long-running applications (ASP.NET) where memory leaks can accumulate to bring down the server, managed is also preferable.

提交回复
热议问题