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

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

    If you are looking for performance, I tested a few hash keys, and I recommend Bob Jenkin's hash function. It is both crazy fast to compute and will give as few collisions as the cryptographic hash you used until now.

    I don't know C# at all, and I don't know if it can link with C, but here is its implementation in C.

提交回复
热议问题