![]() |
Cuberite
A lightweight, fast and extensible game server for Minecraft
|
Calculates a SHA1 checksum for data stream. More...
#include <Sha1Checksum.h>
Public Types | |
typedef Byte | Checksum[20] |
Public Member Functions | |
cSha1Checksum (void) | |
bool | DoesAcceptInput (void) const |
Returns true if the object is accepts more input data, false if Finalize()-d (need to Restart()) More... | |
void | Finalize (Checksum &a_Output) |
Calculates and returns the final checksum. More... | |
void | Restart (void) |
Clears the current context and start a new checksum calculation. More... | |
void | Update (const Byte *a_Data, size_t a_Length) |
Adds the specified data to the checksum. More... | |
Static Public Member Functions | |
static void | DigestToHex (const Checksum &a_Digest, AString &a_Out) |
Converts a SHA1 digest into hex. More... | |
static void | DigestToJava (const Checksum &a_Digest, AString &a_Out) |
Converts a raw 160-bit SHA1 digest into a Java Hex representation According to http://wiki.vg/Protocol_Encryption. More... | |
Protected Attributes | |
bool | m_DoesAcceptInput |
True if the object is accepts more input data, false if Finalize()-d (need to Restart()) More... | |
mbedtls_sha1_context | m_Sha1 |
Calculates a SHA1 checksum for data stream.
Definition at line 19 of file Sha1Checksum.h.
typedef Byte cSha1Checksum::Checksum[20] |
Definition at line 22 of file Sha1Checksum.h.
cSha1Checksum::cSha1Checksum | ( | void | ) |
Definition at line 55 of file Sha1Checksum.cpp.
Converts a SHA1 digest into hex.
Definition at line 88 of file Sha1Checksum.cpp.
Converts a raw 160-bit SHA1 digest into a Java Hex representation According to http://wiki.vg/Protocol_Encryption.
Definition at line 102 of file Sha1Checksum.cpp.
|
inline |
Returns true if the object is accepts more input data, false if Finalize()-d (need to Restart())
Definition at line 33 of file Sha1Checksum.h.
void cSha1Checksum::Finalize | ( | cSha1Checksum::Checksum & | a_Output | ) |
Calculates and returns the final checksum.
Definition at line 76 of file Sha1Checksum.cpp.
void cSha1Checksum::Restart | ( | void | ) |
Clears the current context and start a new checksum calculation.
Definition at line 142 of file Sha1Checksum.cpp.
void cSha1Checksum::Update | ( | const Byte * | a_Data, |
size_t | a_Length | ||
) |
Adds the specified data to the checksum.
Definition at line 65 of file Sha1Checksum.cpp.
|
protected |
True if the object is accepts more input data, false if Finalize()-d (need to Restart())
Definition at line 48 of file Sha1Checksum.h.
|
protected |
Definition at line 50 of file Sha1Checksum.h.