From be90a7e65d5fccd8d13ac6e4fbd5f67b396ec16e Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Mon, 24 May 2021 17:54:22 +0200 Subject: Added IoHash::FromBLAKE3 --- zencore/include/zencore/iohash.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'zencore') diff --git a/zencore/include/zencore/iohash.h b/zencore/include/zencore/iohash.h index 4eac7e328..2c0c7d128 100644 --- a/zencore/include/zencore/iohash.h +++ b/zencore/include/zencore/iohash.h @@ -32,6 +32,13 @@ struct IoHash return Io; } + static IoHash FromBLAKE3(const BLAKE3& Blake3) + { + IoHash Io; + memcpy(Io.Hash, Blake3.Hash, sizeof Io.Hash); + return Io; + } + static IoHash HashMemory(const void* data, size_t byteCount); static IoHash HashMemory(MemoryView Data) { return HashMemory(Data.GetData(), Data.GetSize()); } static IoHash FromHexString(const char* string); -- cgit v1.2.3