Ignore:
Timestamp:
Feb 25, 2008, 8:21:22 PM (14 years ago)
Author:
charles
Message:

added tr_sha1_to_hex()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/utils.c

    r5065 r5112  
    884884    return ratio;
    885885}
     886
     887void
     888tr_sha1_to_hex( char * out, const uint8_t * sha1 )
     889{
     890    static const char hex[] = "0123456789abcdef";
     891    int i;
     892    for (i = 0; i < 20; i++) {
     893        unsigned int val = *sha1++;
     894        *out++ = hex[val >> 4];
     895        *out++ = hex[val & 0xf];
     896    }
     897    *out = '\0';
     898}
Note: See TracChangeset for help on using the changeset viewer.