BsUtil.h 876 B

1234567891011121314151617181920212223242526
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. namespace BansheeEngine
  5. {
  6. /** @addtogroup General
  7. * @{
  8. */
  9. /** Generates a new hash for the provided type using the default standard hasher and combines it with a previous hash. */
  10. template <class T>
  11. inline void hash_combine(std::size_t& seed, const T& v)
  12. {
  13. std::hash<T> hasher;
  14. seed ^= hasher(v) + 0x9e3779b9 + (seed<<6) + (seed>>2);
  15. }
  16. /** Generates an MD5 hash string for the provided source string. */
  17. String BS_UTILITY_EXPORT md5(const WString& source);
  18. /** Generates an MD5 hash string for the provided source string. */
  19. String BS_UTILITY_EXPORT md5(const String& source);
  20. /** @} */
  21. }