Core/Stream: Add HashAppend overload

This commit is contained in:
SirLynix
2023-03-03 13:19:12 +01:00
parent 34abeeb7bd
commit 0494a72849
4 changed files with 50 additions and 6 deletions

View File

@@ -30,9 +30,9 @@ namespace Nz
* \see ComputeHash
*/
template<typename T>
ByteArray ComputeHash(HashType hash, const T& v)
ByteArray ComputeHash(HashType hash, T&& v)
{
return ComputeHash(*AbstractHash::Get(hash), v);
return ComputeHash(*AbstractHash::Get(hash), std::forward<T>(v));
}
/*!
@@ -49,11 +49,11 @@ namespace Nz
* \see ComputeHash
*/
template<typename T>
ByteArray ComputeHash(AbstractHash& hash, const T& v)
ByteArray ComputeHash(AbstractHash& hash, T&& v)
{
hash.Begin();
HashAppend(hash, v);
HashAppend(hash, std::forward<T>(v));
return hash.End();
}