BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
Go to the documentation of this file.
4 #include <openssl/sha.h>
16 if (size !=
sizeof(
_hash))
27 sha256::operator string()
const {
return str(); }
48 return hash( s.c_str(), s.size() );
57 SHA256_Update( &my->ctx, d, dlen);
61 SHA256_Final((uint8_t*)h.
data(), &my->ctx );
65 SHA256_Init( &my->ctx);
104 to_variant( std::vector<char>( (
const char*)&bi, ((
const char*)&bi) +
sizeof(bi) ), v, max_depth );
108 std::vector<char> ve = v.
as< std::vector<char> >( max_depth );
109 memset( &bi,
char(0),
sizeof(bi) );
111 memcpy( &bi, ve.
data(), std::min<size_t>(ve.size(),
sizeof(bi)) );
115 unsigned int hmac<sha256>::internal_block_size()
const {
return 64; }
Used to generate a useful error report when an exception is thrown.
void write(const char *d, uint32_t dlen)
friend bool operator<(const sha256 &h1, const sha256 &h2)
static constexpr size_t data_size()
void from_variant(const variant &var, flat_set< T, A... > &vo, uint32_t _max_depth)
std::string to_hex(const char *d, uint32_t s)
friend T & operator>>(T &ds, sha256 &ep)
friend bool operator!=(const sha256 &h1, const sha256 &h2)
friend bool operator==(const sha256 &h1, const sha256 &h2)
T as(uint32_t max_depth) const
friend bool operator>(const sha256 &h1, const sha256 &h2)
boost::endian::little_uint64_buf_t _hash[4]
void to_variant(const flat_set< T, A... > &var, variant &vo, uint32_t _max_depth)
friend T & operator<<(T &ds, const sha256 &ep)
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Defines exception's used by fc.
friend bool operator>=(const sha256 &h1, const sha256 &h2)
friend sha256 operator^(const sha256 &h1, const sha256 &h2)
#define FC_THROW_EXCEPTION(EXCEPTION, FORMAT,...)
static sha256 hash(const char *d, uint32_t dlen)