mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 00:56:44 +01:00
forgot
This commit is contained in:
parent
4f0237bcda
commit
4d456a1833
18
util/md5.hpp
Normal file
18
util/md5.hpp
Normal file
@ -0,0 +1,18 @@
|
||||
// md5.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "md5.h"
|
||||
|
||||
typedef unsigned char md5digest[16];
|
||||
|
||||
inline void md5(const void *buf, int nbytes, md5digest digest) {
|
||||
md5_state_t st;
|
||||
md5_init(&st);
|
||||
md5_append(&st, (const md5_byte_t *) buf, nbytes);
|
||||
md5_finish(&st, digest);
|
||||
}
|
||||
|
||||
inline void md5(const char *str, md5digest digest) {
|
||||
md5(str, strlen(str), digest);
|
||||
}
|
Loading…
Reference in New Issue
Block a user