adding digest helper utility
This commit is contained in:
parent
d1f51dd643
commit
42ff2b10de
1 changed files with 15 additions and 0 deletions
15
include/fc/crypto/digest.hpp
Normal file
15
include/fc/crypto/digest.hpp
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#pragma once
|
||||
#include <fc/io/raw.hpp>
|
||||
#include <fc/reflect/reflect.hpp>
|
||||
#include <fc/crypto/sha256.hpp>
|
||||
|
||||
namespace fc {
|
||||
|
||||
template<typename T>
|
||||
fc::sha256 digest( const T& value )
|
||||
{
|
||||
fc::sha256::encoder enc;
|
||||
fc::raw::pack( enc, value );
|
||||
return enc.result();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue