Fastest Hash Algorithm for Text Data

前端 未结 8 911
無奈伤痛
無奈伤痛 2020-12-08 11:25

I\'m trying to choose a hash algorithm for comparing about max 20 different text data.

Which hash is better for these requirements?

  • Less CPU Consumpti
相关标签:
8条回答
  • 2020-12-08 12:04

    I had the same request for myselve and i implemented xxHashSharp . Just make sure you take the appropriate library ( x32 vs x64). It's also available outside of c# here

    0 讨论(0)
  • 2020-12-08 12:07

    The FNV hash is a well-known fast hashing algorithm. It is not cryptographically secure, but it sounds like you don't need a secure hash.

    0 讨论(0)
  • 2020-12-08 12:11

    If collision is not a big deal you can take the first letter of each document. Or you can use the length of the text or the string with the text.

    0 讨论(0)
  • 2020-12-08 12:11

    Check out the serie Peter Karkowski published on his blog.

    0 讨论(0)
  • 2020-12-08 12:16

    Paul Hsieh has a decent, simple, fast, 32-bit SuperFastHash that performs better than most existing hash functions, is easier to understand/implement, and sounds like it meets your criteria.

    0 讨论(0)
  • 2020-12-08 12:23

    If you are constrained to algorithms that exist in the framework

    Is MD5 small enough (16 bytes)?

    Less CPU Consumption and Small footprint are usually mutually exclusive.

    http://en.wikipedia.org/wiki/Time-space_tradeoff

    0 讨论(0)
提交回复
热议问题