libktorrent  2.1.1
Public Member Functions | List of all members
bt::SHA1HashGen Class Reference

#include <sha1hashgen.h>

Public Member Functions

void end ()
 
SHA1Hash generate (const Uint8 *data, Uint32 len)
 
SHA1Hash get () const
 
void start ()
 
void update (const Uint8 *data, Uint32 len)
 

Detailed Description

Author
Joris Guisson

Generates a SHA1 hash, code based on wikipedia's pseudocode There are 2 ways to use this class :

Mixing the 2, is not a good idea

Definition at line 45 of file sha1hashgen.h.

Member Function Documentation

◆ end()

void bt::SHA1HashGen::end ( )

All data has been delivered, calculate the final hash.

Returns

◆ generate()

SHA1Hash bt::SHA1HashGen::generate ( const Uint8 *  data,
Uint32  len 
)

Generate a hash from a bunch of data.

Parameters
dataThe data
lenThe length
Returns
The SHA1 hash

◆ get()

SHA1Hash bt::SHA1HashGen::get ( ) const

Get the hash generated.

◆ start()

void bt::SHA1HashGen::start ( )

Start SHA1 hash generation in chunks.

◆ update()

void bt::SHA1HashGen::update ( const Uint8 *  data,
Uint32  len 
)

Update the hash.

Parameters
dataThe data
lenLength of the data

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