15 typedef unsigned __int8 uint8_t;
16 typedef unsigned __int32 uint32_t;
17 typedef unsigned __int64 uint64_t;
43 enum { BlockSize = 512 / 8, HashBytes = 20 };
49 std::string
operator()(
const void* data,
size_t numBytes);
51 std::string
operator()(
const std::string& text);
54 void add(
const void* data,
size_t numBytes);
59 void getHash(
unsigned char buffer[SHA1::HashBytes]);
66 void processBlock(
const void* data);
75 uint8_t m_buffer[BlockSize];
77 enum { HashValues = HashBytes / 4 };
79 uint32_t m_hash[HashValues];
SHA1()
same as reset()
Definition: sha1.cpp:18
std::string getHash()
return latest hash as 40 hex characters
Definition: sha1.cpp:268
void add(const void *data, size_t numBytes)
add arbitrary number of bytes
Definition: sha1.cpp:158
std::string operator()(const void *data, size_t numBytes)
compute SHA1 of a memory block
Definition: sha1.cpp:314
void reset()
restart
Definition: sha1.cpp:25
compute SHA1 hash
Definition: sha1.h:39