Adobe Source Libraries  1.43
Public Types | Public Member Functions | Static Public Member Functions | List of all members
sha< Traits > Class Template Reference

Public Types

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 757 of file sha.hpp.

Member Function Documentation

static 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 907 of file sha.hpp.

std::string to_string ( bool  spaces = false)

Definition at line 938 of file sha.hpp.