diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-09-10 23:16:00 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-09-10 23:16:00 +0000 |
commit | cf866e0109fae335b6d5d137b2370baabc7fa318 (patch) | |
tree | d5da1055f781a8a7c6c54eaaeb30a476867caa4a /util.c | |
parent | 808b9e611c01c0ddb46bc25c7ac79907c91ec3ed (diff) |
Move the base-64 routines to "epan/base64.c".
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11960 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 33 |
1 files changed, 0 insertions, 33 deletions
@@ -254,39 +254,6 @@ compute_timestamp_diff(gint *diffsec, gint *diffusec, } } -/* Decode a base64 string in-place - simple and slow algorithm. - Return length of result. Taken from rproxy/librsync/base64.c by - Andrew Tridgell. */ - -size_t epan_base64_decode(char *s) -{ - static const char b64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - int bit_offset, byte_offset, idx, i, n; - unsigned char *d = (unsigned char *)s; - char *p; - - n=i=0; - - while (*s && (p=strchr(b64, *s))) { - idx = (int)(p - b64); - byte_offset = (i*6)/8; - bit_offset = (i*6)%8; - d[byte_offset] &= ~((1<<(8-bit_offset))-1); - if (bit_offset < 3) { - d[byte_offset] |= (idx << (2-bit_offset)); - n = byte_offset+1; - } else { - d[byte_offset] |= (idx >> (bit_offset-2)); - d[byte_offset+1] = 0; - d[byte_offset+1] |= (idx << (8-(bit_offset-2))) & 0xFF; - n = byte_offset+2; - } - s++; i++; - } - - return n; -} - /* Try to figure out if we're remotely connected, e.g. via ssh or Terminal Server, and create a capture filter that matches aspects of the connection. We match the following environment variables: |