Rudiments
Public Member Functions | List of all members
sha1 Class Reference

Inherits hash.

Public Member Functions

 sha1 ()
 
virtual ~sha1 ()
 
bool append (const byte_t *data, uint32_t size)
 
const byte_t * getHash ()
 
uint64_t getHashSize ()
 
bool clear ()
 
hasherror_t getError ()
 
- Public Member Functions inherited from hash
 hash ()
 
virtual ~hash ()
 
virtual bool setSalt (const byte_t *salt, size_t size)
 
virtual const byte_t * getSalt ()
 
virtual size_t getSaltSize ()
 
virtual bool reset ()
 
- Public Member Functions inherited from object
virtual ~object ()
 

Detailed Description

The sha1 class provides a simple sha1 implementation.

Constructor & Destructor Documentation

◆ sha1()

sha1::sha1 ( )

Creates an instance of the sha1 class.

◆ ~sha1()

virtual sha1::~sha1 ( )
virtual

Deletes this instance of the sha1 class.

Member Function Documentation

◆ append()

bool sha1::append ( const byte_t *  data,
uint32_t  size 
)
virtual

Appends "size" bytes of "data" to the data to be hashed. Returns true on success or false if an error occurred.

Reimplemented from hash.

◆ clear()

bool sha1::clear ( )
virtual

Clears the current hash and any data that had previously been appended. Returns true on success or false if an error occurred.

Reimplemented from hash.

◆ getError()

hasherror_t sha1::getError ( )
virtual

Returns the most recent error.

Reimplemented from hash.

◆ getHash()

const byte_t* sha1::getHash ( )
virtual

Returns the current hash on success or NULL if an error occurred. Note that the current hash will be an empty string if no data has been appended yet.

Implements hash.

◆ getHashSize()

uint64_t sha1::getHashSize ( )
virtual

Returns the number of bytes in the hash.

Reimplemented from hash.