|
A library for working with phylogenetic and population genetic data.
v0.32.0
|
|
Go to the documentation of this file. 1 #ifndef GENESIS_UTILS_TOOLS_HASH_SHA1_H_
2 #define GENESIS_UTILS_TOOLS_HASH_SHA1_H_
108 static std::string
read_hex( std::shared_ptr<BaseInputSource> source );
127 void update( std::shared_ptr<BaseInputSource> source );
132 void update( std::string
const& s );
137 void update( std::istream& is );
157 uint32_t rol_(
const uint32_t value,
const size_t bits);
161 const uint32_t block[
SHA1::BlockInts],
const uint32_t v, uint32_t& w,
const uint32_t x,
162 const uint32_t y, uint32_t& z,
const size_t i
165 uint32_t block[
SHA1::BlockInts],
const uint32_t v, uint32_t& w,
const uint32_t x,
166 const uint32_t y, uint32_t& z,
const size_t i
169 uint32_t block[
SHA1::BlockInts],
const uint32_t v, uint32_t& w,
const uint32_t x,
170 const uint32_t y, uint32_t& z,
const size_t i
173 uint32_t block[
SHA1::BlockInts],
const uint32_t v, uint32_t& w,
const uint32_t x,
174 const uint32_t y, uint32_t& z,
const size_t i
177 uint32_t block[
SHA1::BlockInts],
const uint32_t v, uint32_t& w,
const uint32_t x,
178 const uint32_t y, uint32_t& z,
const size_t i
189 void buffer_to_block_(
const std::string& buffer, uint32_t block[
SHA1::BlockInts]);
226 result ^= s[0] ^ (
static_cast<result_type>( s[1] ) << 32 );
227 result ^= s[2] ^ (
static_cast<result_type>( s[3] ) << 32 );
234 #endif // include guard
genesis::utils::SHA1::DigestType argument_type
static DigestType read_digest(std::shared_ptr< BaseInputSource > source)
Calculate the hash digest for the content of an input source.
result_type operator()(argument_type const &s) const
std::string final_hex()
Finish the calculation, prepare the object for next use, and return the hash.
static const size_t BlockInts
std::array< uint32_t, 5 > DigestType
Store a SHA1 digest.
static const size_t BlockBytes
static std::string read_hex(std::shared_ptr< BaseInputSource > source)
Calculate the checksum for the content of an input source.
void clear()
Reset to initial state, that is, delete any intermediate input from update() calls.
void update(std::shared_ptr< BaseInputSource > source)
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
static std::string digest_to_hex(DigestType const &digest)
DigestType final_digest()
Finish the calculation, prepare the object for next use, and return the digest.
static DigestType hex_to_digest(std::string const &hex)
SHA1 & operator=(SHA1 const &)=default
Calculate SHA1 hashes for strings and files.
SHA1()
Initialize the object for use.