本文介绍了STL散列函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请问STL有任何Hash函数可用的,被公开曝光?

Does the STL have any Hash functions available, that are exposed publicly?

我知道有一些使用哈希值(如boost ::的hash_map)非标准的实现,以及MSVC8实现了一个版本的hash_map /的hash_set /等。

I know that there are some non-standard implementations that use hash values (such as boost::hash_map), and MSVC8 implements a version of the hash_map/hash_set/etc.

但是否有任何散列函数这是在C ++ STL 98定义的?

But are there any Hash Functions that are defined in the C++98 STL?

如果不是,有什么可靠的散列函数的最佳非C ++ 98的来源?

If not, what are the best non-C++98 sources of a reliable hash function?

订单preferred源(从最能接受的最少)的:加速,C ++ 0x中的标准STL,TR1,其他第三方

Order of preferred sources (from most acceptable to least): Boost, C++0x standard STL, TR1, other 3rd party.

推荐答案

总结:

  • The STL has hash functions
  • The C++98 standard library does not
  • The C++ TR1 has hash functions (6.3.3[tr.unord.hash])
  • boost has hash functions
  • The C++11 standard library has hash functions (20.8.12[unord.hash])

和所有的人都适用于哈希关联容器,而不是密码。

And all of them are designed for hashed associative containers, not for cryptography.

这篇关于STL散列函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 16:48