Wolframe, 0.0.3

_Wolframe::AAAA::UsernameHash Class Reference

#include <usernameHash.hpp>

Public Member Functions

 UsernameHash (const crypto::RandomGenerator &rndGen, const std::string &username)
 
 UsernameHash (const unsigned char *slt, std::size_t sltSize, const std::string &username)
 
 UsernameHash (const std::string &hashString)
 
 ~UsernameHash ()
 
unsigned char * salt ()
 
std::size_t saltSize () const
 
unsigned char * hash ()
 
std::size_t hashSize () const
 
std::string toString () const
 Return a base64 string in the format $<salt>$<hash> More...
 
std::string toBCD () const
 Return a BCD string in the format <salt>:<hash> More...
 
bool operator== (const UsernameHash &rhs)
 True if the 2 user hashes are identical, false otherwise. More...
 
bool operator!= (const UsernameHash &rhs)
 
bool operator== (const std::string &rhs)
 
bool operator!= (const std::string &rhs)
 

Private Attributes

std::size_t m_saltSize
 
unsigned char m_salt [USERNAME_HASH_SALT_SIZE]
 
unsigned char m_hash [USERNAME_HASH_SIZE]
 

Constructor & Destructor Documentation

_Wolframe::AAAA::UsernameHash::UsernameHash ( const crypto::RandomGenerator rndGen,
const std::string &  username 
)
_Wolframe::AAAA::UsernameHash::UsernameHash ( const unsigned char *  slt,
std::size_t  sltSize,
const std::string &  username 
)
_Wolframe::AAAA::UsernameHash::UsernameHash ( const std::string &  hashString)
_Wolframe::AAAA::UsernameHash::~UsernameHash ( )

Member Function Documentation

unsigned char* _Wolframe::AAAA::UsernameHash::hash ( )
inline
std::size_t _Wolframe::AAAA::UsernameHash::hashSize ( ) const
inline
bool _Wolframe::AAAA::UsernameHash::operator!= ( const UsernameHash rhs)
inline
bool _Wolframe::AAAA::UsernameHash::operator!= ( const std::string &  rhs)
inline
bool _Wolframe::AAAA::UsernameHash::operator== ( const UsernameHash rhs)

True if the 2 user hashes are identical, false otherwise.

bool _Wolframe::AAAA::UsernameHash::operator== ( const std::string &  rhs)
inline

True if the hash base64 encoding is equivalent to the given argument, false otherwise.

Note
The strings are base64 encoded, with or without end padding.
unsigned char* _Wolframe::AAAA::UsernameHash::salt ( )
inline
std::size_t _Wolframe::AAAA::UsernameHash::saltSize ( ) const
inline
std::string _Wolframe::AAAA::UsernameHash::toBCD ( ) const

Return a BCD string in the format <salt>:<hash>

std::string _Wolframe::AAAA::UsernameHash::toString ( ) const

Return a base64 string in the format $<salt>$<hash>

Member Data Documentation

unsigned char _Wolframe::AAAA::UsernameHash::m_hash[USERNAME_HASH_SIZE]
private
unsigned char _Wolframe::AAAA::UsernameHash::m_salt[USERNAME_HASH_SALT_SIZE]
private
std::size_t _Wolframe::AAAA::UsernameHash::m_saltSize
private

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