diff options
author | Kevin Chabowski <kevin@kch42.de> | 2014-03-21 14:50:06 +0100 |
---|---|---|
committer | Kevin Chabowski <kevin@kch42.de> | 2014-03-21 14:50:06 +0100 |
commit | 9f0a8395b31e30634296145219392770b2b0ffff (patch) | |
tree | cb90e415c035cac9a38cf719e21a51d69c6e60ba /README.markdown | |
download | buzhash-9f0a8395b31e30634296145219392770b2b0ffff.tar.gz buzhash-9f0a8395b31e30634296145219392770b2b0ffff.tar.bz2 buzhash-9f0a8395b31e30634296145219392770b2b0ffff.zip |
Initial commit.
Originally this was part of a larger, now discontinued, project. I chose
to publish some parts of it that might be useful to others.
Diffstat (limited to 'README.markdown')
-rw-r--r-- | README.markdown | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown new file mode 100644 index 0000000..11d415f --- /dev/null +++ b/README.markdown @@ -0,0 +1,24 @@ +# buzhash + +Package buzhash implements a buzhash algorithm using this defintion <http://en.wikipedia.org/wiki/Rolling_hash#Cyclic_polynomial>. + +## Rolling hash + +Buzhash is a rolling hash function, that means that the current hash sum is the sum of the last n consumed bytes. + +Example: + +* Message 1: <code>This is a stupid example text to demo<strong>nstrate buzhash.</strong></code> +* Message 2: <code>Another text to demo<strong>nstrate buzhash.</strong></code> + +When hashing both messages with a buzhasher with n=16, both messages will have the same hash sum, since the last 16 characters (`nstrate buzhash.`) are equal. + +This can be useful, when searching for a data fragment in large files, without knowing the fragment (only its hash). This is used in binary diff tools, such as `rdiff` (although they use a different rolling hash function). + +## Installation + +`go get github.com/kch42/buzhash` + +## Documentation + +Either install the package and use a local godoc server or use [godoc.org](http://godoc.org/github.com/kch42/buzhash) |