What is a Murmurhash?

Asked

Viewed 334 times

8

I saw that is being programmed for next version of PHP 8.1 the implementation of Murmurhash.

I had never heard of it. I would like to know what it is.

  • 8

    It is a non-ccriptographic hash (not for security, can serve for integrity), but that of slutty in this link his was compared to cryptographic (it would be fair to have CRC32 in the list, I suspect that he loses, or at most tie). Just like CRC32, it is incremental (stream), that is, you can go calculating it without needing it in memory entirely, using the previous value and "increments". Edit: confirmed on a longer link, it loses pro CRC32: https://php.watch/articles/php-hash-benchmark - what’s interesting about some of the variations is that it has more bits than CRC32

  • 2

    Big dog fight.

2 answers

9


Murmurhash (Murmur hash algorithm family) is a non-cryptographic hash with a focus on high performance, optimization and collision resistance.

Introducing

To understand the motivation behind Murmurhash (a non-ccriptographic hash), one must first understand some of the main factors necessary for a hash algorithm to be considered critptographic:

  • Resistance to collisions;
  • Resistant to attack pre-image;
  • Good avalanche effect (this means, in short, that changing a tiny part of the input represents huge change in the output).
  • Deterministic (the same input must at all times produce the same output).
  • Be unidirectional (so as to make it impossible to get the original message from the hash).

Once any of these requirements have not been properly met, the algorithm is no longer considered cryptographic hash function, to be called hash function nay cryptographic.

Do not think that a cryptographic hash function loses its usefulness by not serving cryptographic purposes. Although some algorithms such as MD5 or SHA1 have been downgraded from cryptographic hashes to the classification of nay cryptographic (to the detriment of their respective obsolescences), some hashes are developed as non-ccriptographic from the start to perform some tasks with superior performance. This is the case of Murmurhash.

Trade offs: Trade offs everywhere

Murmurhash

The name came from the two basic operations used in its implementation, multiplication (MU) and rotation (R). From English, multiply and rotate.

In short, Murmur family algorithms give up part of "cryptographic security" to increase efficiency and performance. Thus, Murmurhash:

  • It is simple in terms of the amount of Assembly instructions generated;
  • Good avalanche effect;
  • Good collision resistance (for up to 4-bit collision keys are guaranteed to be impossible);
  • Optimized for Intel/AMD architecture, so it represents a good tradeoff between hash quality and CPU consumption.

Note then that Murmurhash gives up a certain part of security (specifically reversibility resistance) for performance gains and optimization.

While not ideal for cryptographic purposes, it may be a good option for implementations of certain types of hash Tables, as it is fast and relatively resistant to collisions.

Also, Murmurhash is a streaming hash, which means that values can be updated in sequence without the need to recompute using the entire string. That is, it can be used incrementally, something extremely useful in strems data.

Another example of interesting use here.

Reference

Resources and sources I used to prepare this response.

-5

It’s a noncryptographic algorithm created by Austin Appleby.

It is designed to perform highly in the use of search and content identifications but not for security encryption

Has libs for various languages like python and nodejs

Take a look at the repository https://github.com/ksss/digest-murmurhash

  • 5

    That anyone can say. The same has already been made clear in the comments to prevent anyone from responding trivially. The other comment was very explicit "Big Dog Fight" the responses competing for votes and rewards should have technical content. The author wants to know formally, how the algorithm works.

  • Okay, no problem, but your question was "I’ve never heard of it. I’d like to know what it’s about." I believe I answered what it is. If you want to know more about the algorithm, just look at the code in the link I put there! Thanks. Hug.

  • 2

    Take a look at the author’s profile. He writes cryptographic algorithms with his hands tied.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.