BsUtil.h 619 B

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