sha.h
/*
Copyright (c) 2006-2023 by Jakob Schröter <js@camaya.net>
This file is part of the gloox library. http://camaya.net/gloox
This software is distributed under a license. The full license
agreement can be found in the file LICENSE in this distribution.
This software may not be copied, modified, sold or distributed
other than expressed in the named license agreement.
This software is distributed without any warranty.
*/
#ifndef SHA_H__
#define SHA_H__
#include "macros.h"
#include <string>
namespace gloox
{
class GLOOX_API SHA
{
public:
SHA();
virtual ~SHA();
void reset();
void finalize();
const std::string hex();
const std::string binary();
void feed( const unsigned char* data, unsigned length );
void feed( const std::string& data );
private:
void process();
void pad();
inline unsigned shift( int bits, unsigned word );
void init();
unsigned H[5];
unsigned Length_Low;
unsigned Length_High;
unsigned char Message_Block[64];
int Message_Block_Index;
bool m_finished;
bool m_corrupted;
};
}
#endif // SHA_H__
gloox::SHA::finalize
void finalize()
Definition sha.cpp:80
gloox::SHA::SHA
SHA()
Definition sha.cpp:23
gloox::SHA::feed
void feed(const unsigned char *data, unsigned length)
Definition sha.cpp:89
gloox::SHA::binary
const std::string binary()
Definition sha.cpp:68
gloox::SHA::hex
const std::string hex()
Definition sha.cpp:53
gloox::SHA::reset
void reset()
Definition sha.cpp:48
gloox
The namespace for the gloox library.
Definition adhoc.cpp:28