44#ifndef _NBL_CORE_HASH_BLAKE3_H_INCLUDED_
55#define _NBL_CORE_HASH_BLAKE3_H_INCLUDED_
66
7-
87#include " blake3.h"
98
109#include < span>
1110
12-
1311namespace nbl ::core
1412{
1513struct blake3_hash_t final
@@ -21,7 +19,7 @@ struct blake3_hash_t final
2119 uint8_t data[BLAKE3_OUT_LEN];
2220};
2321
24- class blake3_hasher final
22+ class NBL_API2 blake3_hasher final
2523{
2624 template <typename T, typename Dummy=void >
2725 struct update_impl
@@ -39,31 +37,17 @@ class blake3_hasher final
3937 ::blake3_hasher m_state;
4038
4139 public:
42- inline blake3_hasher ()
43- {
44- ::blake3_hasher_init (&m_state);
45- }
40+ blake3_hasher ();
4641
47- inline blake3_hasher& update (const void * data, const size_t bytes)
48- {
49- ::blake3_hasher_update (&m_state,data,bytes);
50- return *this ;
51- }
42+ blake3_hasher& update (const void * data, const size_t bytes);
5243
5344 template <typename T>
54- blake3_hasher& operator <<(const T& input)
55- {
56- update_impl<T>::__call (*this ,input);
45+ blake3_hasher& operator <<(const T& input) {
46+ update_impl<T>::__call (*this , input);
5747 return *this ;
5848 }
5949
60- explicit inline operator blake3_hash_t () const
61- {
62- blake3_hash_t retval;
63- // the blake3 docs say that the hasher can be finalized multiple times
64- ::blake3_hasher_finalize (&m_state,retval.data,sizeof (retval));
65- return retval;
66- }
50+ explicit operator blake3_hash_t () const ;
6751};
6852
6953// Useful specializations
0 commit comments