00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "config.h"
00021 #include "librsync.h"
00022
00023 void rs_hexify(char *to_buf, void const *from, int from_len)
00024 {
00025 static const char hex_chars[] = "0123456789abcdef";
00026 unsigned char const *from_buf = (unsigned char const *)from;
00027
00028 while (from_len-- > 0) {
00029 *(to_buf++) = hex_chars[((*from_buf) >> 4) & 0xf];
00030 *(to_buf++) = hex_chars[(*from_buf) & 0xf];
00031 from_buf++;
00032 }
00033
00034 *to_buf = 0;
00035 }