What does it mean for a hash function to be incremental?

你。 提交于 2019-12-03 03:36:31

Incremental hash functions suited for situations where if a previously hashed message, M is slightly updated into a new message, M*, then it should be fairly quick to compute the hash value of the updated message, M*. This is done by computing the new hash, m*, from the old hash value, m, in contrast to conventional hash functions that have to recompute the new hash, m* from scratch, which takes a longer time.

http://www.cs.berkeley.edu/~daw/papers/inchash-cs06.pdf

They're useful due to the fact that they're easier to compute and therefore less expensive in terms of computing power and time.

However they're not suited to every situation. That paper from Berkeley has some nice examples of when they can be useful in the Introduction section.

I'm not an expert on this, but I think MurmurHash3 is not incremental in the sense tommarshall describes.

When people describe it as incremental they probably mean that you can compute hash of a stream in O(1) memory, i.e. you can have an API that let you do the following (in pseudocode):

x = Hasher()
x.add("hello ")
x.add("world!")
x.get_hash()

and that would produce a hash of string "hello world" without keeping the whole string in memory at any point in time.

In particular, the imurmurhash-js javascript package seems to use the word 'incremental' in that meaning.

Same meaning seems to be used in MetroHash docs.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!