Skip to content

silvasur/buzhash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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: This is a stupid example text to demonstrate buzhash.
  • Message 2: Another text to demonstrate buzhash.

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/silvasur/buzhash

Documentation

Either install the package and use a local godoc server or use godoc.org

About

A Go library implementing a buzhash rolling hash function

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages