mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 02:38:09 +09:00
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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user