BsUtil.h 621 B

12345678910111213141516171819202122232425
  1. #pragma once
  2. namespace BansheeEngine
  3. {
  4. /**
  5. * @brief Generates a new hash for the provided type using the default standard
  6. * hasher and combines it with a previous hash.
  7. */
  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. /**
  15. * @brief Generates an MD5 hash string for the provided source string.
  16. */
  17. String BS_UTILITY_EXPORT md5(const WString& source);
  18. /**
  19. * @brief Generates an MD5 hash string for the provided source string.
  20. */
  21. String BS_UTILITY_EXPORT md5(const String& source);
  22. }