Format _bin_to_base64().

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@740 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
Andreas Schneider
2009-05-05 09:07:09 +00:00
parent 2e5f1c8955
commit f7d2040d5a

View File

@@ -228,8 +228,9 @@ static int get_equals(char *string) {
} }
/* thanks sysk for debugging my mess :) */ /* thanks sysk for debugging my mess :) */
#define BITS(n) ((1<<n)-1) #define BITS(n) ((1 << (n)) - 1)
static void _bin_to_base64(unsigned char *dest, unsigned char source[3], int len){ static void _bin_to_base64(unsigned char *dest, unsigned char source[3],
int len) {
switch (len) { switch (len) {
case 1: case 1:
dest[0] = alphabet[(source[0] >> 2)]; dest[0] = alphabet[(source[0] >> 2)];
@@ -251,6 +252,7 @@ static void _bin_to_base64(unsigned char *dest, unsigned char source[3], int len
break; break;
} }
} }
/** \brief Converts binary data to a base64 string /** \brief Converts binary data to a base64 string
* \returns the converted string * \returns the converted string
* \internal * \internal