diff options
| author | Stefan Boberg <[email protected]> | 2021-05-24 17:54:22 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-05-24 17:54:22 +0200 |
| commit | be90a7e65d5fccd8d13ac6e4fbd5f67b396ec16e (patch) | |
| tree | bde30b1d8306a42fa170e675371a713135408eba | |
| parent | Fixed up legacy cache store for CRC32 function rename (diff) | |
| download | zen-be90a7e65d5fccd8d13ac6e4fbd5f67b396ec16e.tar.xz zen-be90a7e65d5fccd8d13ac6e4fbd5f67b396ec16e.zip | |
Added IoHash::FromBLAKE3
| -rw-r--r-- | zencore/include/zencore/iohash.h | 7 |
1 files changed, 7 insertions, 0 deletions
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); |