Hashing multiple byte[]'s together into a single hash with C#?

前端 未结 6 1094
生来不讨喜
生来不讨喜 2020-12-16 17:54

I have three fields: string Title, byte[] Body, and byte[] Data, from which I want to calculate a single hash as a check to be sure th

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-16 18:29

    Using plain .NET, I don't think there is a way to update and MD5 hash. However, Windows has an MD5Update function defined in crypt.dll. You could use Interop to leverage this I suppose.

    Otherwise, there is an implementation of a PHP equivalent in .NET c#, located here on SO: Problem porting PHP crypt() function to C#

    PS: I would definitely go for the combined temp variable solution :-)

提交回复
热议问题