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

前端 未结 11 1596
故里飘歌
故里飘歌 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:53

    RuntimeHelpers.GetHashCode might help:

    From Msdn:

    Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures such as a hash table.

提交回复
热议问题