How do I generate a hashcode from a byte array in C#?

前端 未结 11 1567
故里飘歌
故里飘歌 2020-11-27 14:21

Say I have an object that stores a byte array and I want to be able to efficiently generate a hashcode for it. I\'ve used the cryptographic hash functions for this in the pa

11条回答
  •  抹茶落季
    2020-11-27 14:50

    Have you compared with the SHA1CryptoServiceProvider.ComputeHash method? It takes a byte array and returns a SHA1 hash, and I believe it's pretty well optimized. I used it in an Identicon Handler that performed pretty well under load.

提交回复
热议问题