mozilla/rust — pull request #11863 by erickt (2014-01-28 04:52:23+00:00)
Title: First phase of a Hash reimplementation

This PR is not quite finished yet, but I was hoping for some comments. It's the first part of merging `IterBytes` and `Hash`. It also supports non-stream-style hashes.

My questions:

* should the `SipHasher` helper methods like `result_bytes` and `result_str` be exposed to the end user?
* should a `StreamHasher` be resettable?
* should `SipHasher` helper methods be moved into `Hasher` or `StreamHasher`?
* should `Hasher::hash2` consume the hasher?
* should `Hasher::hash2` reset after computing a hash? Right now `hasher1.hash2(a); hasher1.hash2(b)` does not equal `hasher1.hash2(a); hasher2.hash(b)`.

Things left to implement:

* `#[deriving(Hash)]`
* Migrating `HashMap` to the new hasher
* Removing the old `std::hash` library.

Fixes #8038.