From f3a23ab81fd5aae6ff23177460fb207dc5d52fc1 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Fri, 21 Sep 2018 23:24:17 +0200 Subject: [PATCH] [util] Add convenience method for SHA1 hash compulation --- src/util/sha1/sha1_util.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/util/sha1/sha1_util.h b/src/util/sha1/sha1_util.h index 4b98f12e..ae09323b 100644 --- a/src/util/sha1/sha1_util.h +++ b/src/util/sha1/sha1_util.h @@ -36,6 +36,13 @@ namespace dxvk { const uint8_t* data, size_t size); + template + static Sha1Hash compute(const T& data) { + auto bytes = reinterpret_cast(&data); + return compute(bytes, sizeof(T)); + } + + private: Sha1Digest m_digest;