blob: 83b3c60d0255eba0eb44ba4a5b72c107f79fd825 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#include "buffer.h"
#include "http_auth_digest.h"
#include <string.h>
#ifndef USE_OPENSSL
# include "md5.h"
typedef li_MD5_CTX MD5_CTX;
#define MD5_Init li_MD5_Init
#define MD5_Update li_MD5_Update
#define MD5_Final li_MD5_Final
#endif
void CvtHex(IN HASH Bin, OUT HASHHEX Hex) {
unsigned short i;
for (i = 0; i < HASHLEN; i++) {
Hex[i*2] = int2hex((Bin[i] >> 4) & 0xf);
Hex[i*2+1] = int2hex(Bin[i] & 0xf);
}
Hex[HASHHEXLEN] = '\0';
}
|