Ignore:
Timestamp:
Nov 20, 2005 7:55:42 PM (19 years ago)
Author:
bennylp
Message:

Added hex character conversion utility in ctype

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/string.c

    r51 r62  
    2828 
    2929 
    30 static char hex[] = {'0', '1', '2', '3', '4', '5', '6', '7', 
    31                      '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; 
    32  
    3330PJ_DEF(pj_str_t*) pj_strltrim( pj_str_t *str ) 
    3431{ 
     
    5148} 
    5249 
    53 PJ_INLINE(void) pj_val_to_hex_digit(unsigned value, char *p) 
    54 { 
    55     *p++ = hex[ (value & 0xF0) >> 4 ]; 
    56     *p++ = hex[ (value & 0x0F) ]; 
    57 } 
    58  
    5950PJ_DEF(char*) pj_create_random_string(char *str, pj_size_t len) 
    6051{ 
     
    7364    } 
    7465    for (i=i * 8; i<len; ++i) { 
    75         *p++ = hex[ pj_rand() & 0x0F ]; 
     66        *p++ = pj_hex_digits[ pj_rand() & 0x0F ]; 
    7667    } 
    7768    return str; 
     
    130121} 
    131122 
     123 
Note: See TracChangeset for help on using the changeset viewer.