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

前端 未结 11 1603
故里飘歌
故里飘歌 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条回答
  •  旧时难觅i
    2020-11-27 14:38

    Is using the existing hashcode from the byte array field not good enough? Also note that in the Equals method you should check that the arrays are the same size before doing the compare.

提交回复
热议问题