servo / rust-fnv

Fowler–Noll–Vo hash function
https://doc.servo.org/fnv/
Apache License 2.0
338 stars 28 forks source link

Add FnvHasher::with_key() #11

Closed Manishearth closed 8 years ago

Manishearth commented 8 years ago

This change is Reviewable

Ms2ger commented 8 years ago

@bors-servo r+

bors-servo commented 8 years ago

:pushpin: Commit cfd612c has been approved by Ms2ger

bors-servo commented 8 years ago

:hourglass: Testing commit cfd612c with merge 65c1c07...

bors-servo commented 8 years ago

:sunny: Test successful - travis

SimonSapin commented 8 years ago

I was worried about how letting the user choose this number would affect the properties of the hash algorithm. It turns out:

http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param

In the general case, almost any offset_basis will serve so long as it is non-zero.