Changeset 1174899
- Timestamp:
- 2011-07-31T14:40:41Z (13 years ago)
- Branches:
- master
- Children:
- aa9f1ac
- Parents:
- 4a5d885
- Location:
- lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/md5.c
r4a5d885 r1174899 160 160 memcpy(digest, ctx->buf, 16); 161 161 memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ 162 } 163 164 void md5_finish_ascii(struct MD5Context *context, char *ascii) 165 { 166 md5_byte_t bin[16]; 167 int i; 168 169 md5_finish(context, bin); 170 for (i = 0; i < 16; i ++) 171 sprintf(ascii + i * 2, "%02x", bin[i]); 162 172 } 163 173 -
lib/md5.h
r4a5d885 r1174899 43 43 G_MODULE_EXPORT void md5_append(struct MD5Context *context, const md5_byte_t *buf, unsigned int len); 44 44 G_MODULE_EXPORT void md5_finish(struct MD5Context *context, md5_byte_t digest[16]); 45 G_MODULE_EXPORT void md5_finish_ascii(struct MD5Context *context, char *ascii); 45 46 46 47 #endif
Note: See TracChangeset
for help on using the changeset viewer.