diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-04-02 23:30:54 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-04-02 23:30:54 +0000 |
commit | e8345bfced697f96fbb885298e464760988d71e4 (patch) | |
tree | 4e09651306f7d2a007b3681b92e0c340eebe4d8b /src/common/util.c | |
parent | 25a9bc594f22fc29604b17cb0f7eaab74401db29 (diff) | |
download | tor-e8345bfced697f96fbb885298e464760988d71e4.tar.gz tor-e8345bfced697f96fbb885298e464760988d71e4.zip |
refactor; start adding debugging logs to midpoint rend stuff
svn:r1445
Diffstat (limited to 'src/common/util.c')
-rw-r--r-- | src/common/util.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common/util.c b/src/common/util.c index 8dd6dce912..a54ebe559d 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -109,6 +109,17 @@ void set_uint32(char *cp, uint32_t v) } #endif +void hex_encode(const char *from, int fromlen, char *to) +{ + const unsigned char *fp = from; + static const char TABLE[] = "0123456789abcdef"; + while (fromlen) { + *to++ = TABLE[*fp >> 4]; + *to++ = TABLE[*fp & 7]; + ++fp; + } + *to = '\0'; +} /* * A simple smartlist interface to make an unordered list of acceptable |