Boost logo

Boost :

From: Daniel James (daniel_at_[hidden])
Date: 2005-03-10 16:34:23


JOAQUIN LOPEZ MU?Z wrote:
>
> // we modify also range hashing
>
> template<typename It>
> std::size_t hash_range(It first,It last,crypto_impl)
> {
> std::size_t seed=0;
> std::size_t n=1;
> for(;first!=last;++first){
> hash_combine(seed,*first,crypto_impl);
> seed*=n; // for instance
> n*=2;
> }
> return seed;
> }
>
> unordered_set<my_type,boost::hash<my_type,crypto_impl> > us;
>
> What do you think?

Unfortunately, you wouldn't be able to store a cryptographic hash
function's state in a std::size_t.

Daniel


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk