BsUtil.h 649 B

123456789101112131415161718192021222324
  1. #pragma once
  2. namespace BansheeEngine
  3. {
  4. /** @addtogroup General
  5. * @{
  6. */
  7. /** Generates a new hash for the provided type using the default standard hasher and combines it with a previous hash. */
  8. template <class T>
  9. inline void hash_combine(std::size_t& seed, const T& v)
  10. {
  11. std::hash<T> hasher;
  12. seed ^= hasher(v) + 0x9e3779b9 + (seed<<6) + (seed>>2);
  13. }
  14. /** Generates an MD5 hash string for the provided source string. */
  15. String BS_UTILITY_EXPORT md5(const WString& source);
  16. /** Generates an MD5 hash string for the provided source string. */
  17. String BS_UTILITY_EXPORT md5(const String& source);
  18. /** @} */
  19. }