Changeset 1174899 for lib/md5.c


Ignore:
Timestamp:
2011-07-31T14:40:41Z (13 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
aa9f1ac
Parents:
4a5d885
Message:

Having written the same stupid code (ASCII MD5 hashes) 205762 times, time to
have a function for it..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/md5.c

    r4a5d885 r1174899  
    160160        memcpy(digest, ctx->buf, 16);
    161161        memset(ctx, 0, sizeof(ctx));    /* In case it's sensitive */
     162}
     163
     164void 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]);
    162172}
    163173
Note: See TracChangeset for help on using the changeset viewer.