OpenImageIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Static Public Member Functions | List of all members
SHA1 Class Reference

#include <hash.h>

Classes

struct  Hash
 Type for storing the raw bits of the hash. More...
 

Public Member Functions

 SHA1 (const void *data=NULL, size_t size=0)
 Create SHA1, optionally read data.
 
void append (const void *data, size_t size)
 Append more data.
 
template<class T >
void appendvec (const std::vector< T > &v)
 Append more data from a vector, without thinking about sizes.
 
void gethash (Hash &h)
 Get the digest and store it in Hash h.
 
void gethash (void *h)
 
std::string digest ()
 Return the digest as a hex string.
 

Static Public Member Functions

static std::string digest (const void *data, size_t size)
 Roll the whole thing into one functor, return the string digest.
 

Detailed Description

Class that encapsulates SHA-1 hashing, a crypticographic-strength 160-bit hash function. It's not as fast as our other hashing methods, but has an extremely low chance of having collisions.

Constructor & Destructor Documentation

SHA1::SHA1 ( const void *  data = NULL,
size_t  size = 0 
)

Create SHA1, optionally read data.

Member Function Documentation

void SHA1::append ( const void *  data,
size_t  size 
)

Append more data.

template<class T >
void SHA1::appendvec ( const std::vector< T > &  v)
inline

Append more data from a vector, without thinking about sizes.

std::string SHA1::digest ( )

Return the digest as a hex string.

static std::string SHA1::digest ( const void *  data,
size_t  size 
)
inlinestatic

Roll the whole thing into one functor, return the string digest.

void SHA1::gethash ( Hash h)

Get the digest and store it in Hash h.

void SHA1::gethash ( void *  h)
inline

Get the digest and store it in h (must point to enough storage to accommodate 20 bytes).


The documentation for this class was generated from the following file: