Page Speed Optimization Libraries
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
net_instaweb::Hasher Class Referenceabstract
Inheritance diagram for net_instaweb::Hasher:
net_instaweb::MD5Hasher net_instaweb::MockHasher

Public Member Functions

 Hasher (int max_chars)
GoogleString Hash (const StringPiece &content) const
int HashSizeInChars () const
uint64 HashToUint64 (const StringPiece &content) const
 Uses first 64-bits of hash to make a uint64 version of hash.
virtual GoogleString RawHash (const StringPiece &content) const =0
virtual int RawHashSizeInBytes () const =0
 The number of bytes RawHash will produce.

Constructor & Destructor Documentation

net_instaweb::Hasher::Hasher ( int  max_chars)

The passed in max_chars will be used to limit the length of Hash() and HashSizeInChars()

Member Function Documentation

GoogleString net_instaweb::Hasher::Hash ( const StringPiece &  content) const

Computes a web64-encoded hash of a single string. This operation is thread-safe.

This is implemented in terms of RawHash, and honors the length limit passed in to the constructor.

int net_instaweb::Hasher::HashSizeInChars ( ) const

Return string length of hashes produced by this hasher's Hash method.

This is implemented in terms of RawHashSizeInBytes() and the length limit passed in to the constructor.

virtual GoogleString net_instaweb::Hasher::RawHash ( const StringPiece &  content) const
pure virtual

Computes a binary hash of the given content. The returned value is not printable as it is the direct binary encoding of the hash. This operation is thread-safe.

Implemented in net_instaweb::MockHasher, and net_instaweb::MD5Hasher.

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