mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
add const specifier to make md5 more general
This commit is contained in:
@@ -129,7 +129,7 @@ void md5Step(uint32_t *buffer, uint32_t *input){
|
||||
* If the input fills out a block of 512 bits, apply the algorithm (md5Step)
|
||||
* and save the result in the buffer. Also updates the overall size.
|
||||
*/
|
||||
void MD5Context::update(uint8_t *input_buffer, size_t input_len)
|
||||
void MD5Context::update(const uint8_t *input_buffer, size_t input_len)
|
||||
{
|
||||
uint32_t input[16];
|
||||
unsigned int offset = this->size % 64;
|
||||
|
||||
@@ -16,12 +16,12 @@ class PGF_INTERNAL_DECL MD5Context {
|
||||
|
||||
public:
|
||||
MD5Context();
|
||||
void update(uint8_t *input, size_t input_len);
|
||||
void update(const uint8_t *input, size_t input_len);
|
||||
|
||||
template <class T>
|
||||
void update(T &input)
|
||||
void update(const T &input)
|
||||
{
|
||||
update((uint8_t *) &input, sizeof(T));
|
||||
update((const uint8_t *) &input, sizeof(T));
|
||||
}
|
||||
|
||||
void finalize(MD5Digest *digest);
|
||||
|
||||
Reference in New Issue
Block a user