Adobe Source Libraries 2.0.0
A collection of C++ libraries.
Loading...
Searching...
No Matches
sha< Traits > Class Template Reference

#include <sha.hpp>

Public Types

typedef Traits traits_type
typedef traits_type::digest_type digest_type

Public Member Functions

 sha ()
template<typename I>
void update (I first, I last)
template<typename I>
void update (I first, std::uint64_t num_bits)
digest_type finalize ()
std::string to_string (bool spaces=false)

Static Public Member Functions

template<typename I>
static digest_type digest (I first, I last)
template<typename I>
static digest_type digest (I first, std::uint64_t num_bits)
static std::string to_string (const typename traits_type::digest_type &digest, bool spaces=false)

Detailed Description

template<class Traits>
class adobe::sha< Traits >

Generic engine implementation for SHA-*.

Given the similarity of behavior between the SHA-* class of algorithms, the core functionality has been encapsulated in this class.

Users of the class can either call one of the one-shot sha::digest routines or instantiate the class and call sha::update repeatedly, then retrieve the digest with sha::finalize.

Definition at line 764 of file sha.hpp.

Member Typedef Documentation

◆ traits_type

template<class Traits>
typedef Traits traits_type

Definition at line 767 of file sha.hpp.

Member Function Documentation

◆ to_string() [1/2]

template<class Traits>
std::string to_string ( const typename traits_type::digest_type & digest,
bool spaces = false )
static

Returns the finalized digest as an ASCII string.

There is also an optional parameter to add spaces between elements of the digest, defaulting to false.

Definition at line 914 of file sha.hpp.

◆ to_string() [2/2]

template<class Traits>
std::string to_string ( bool spaces = false)

Definition at line 945 of file sha.hpp.