|
a/src/utils/base64.cpp |
|
b/src/utils/base64.cpp |
1 |
#ifndef lint
|
1 |
#ifndef lint
|
2 |
static char rcsid[] = "@(#$Id: base64.cpp,v 1.8 2008-04-18 11:37:50 dockes Exp $ (C) 2005 J.F.Dockes";
|
2 |
static char rcsid[] = "@(#$Id: base64.cpp,v 1.9 2008-09-15 08:01:42 dockes Exp $ (C) 2005 J.F.Dockes";
|
3 |
#endif
|
3 |
#endif
|
4 |
/*
|
4 |
/*
|
5 |
* This program is free software; you can redistribute it and/or modify
|
5 |
* This program is free software; you can redistribute it and/or modify
|
6 |
* it under the terms of the GNU General Public License as published by
|
6 |
* it under the terms of the GNU General Public License as published by
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
|
... |
|
... |
164 |
#undef Assert
|
164 |
#undef Assert
|
165 |
#define Assert(X)
|
165 |
#define Assert(X)
|
166 |
|
166 |
|
167 |
void base64_encode(const string &in, string &out)
|
167 |
void base64_encode(const string &in, string &out)
|
168 |
{
|
168 |
{
|
169 |
size_t datalength = 0;
|
|
|
170 |
unsigned char input[3];
|
169 |
unsigned char input[3];
|
171 |
unsigned char output[4];
|
170 |
unsigned char output[4];
|
172 |
size_t i;
|
|
|
173 |
|
171 |
|
174 |
out.erase();
|
172 |
out.erase();
|
175 |
|
173 |
|
176 |
int srclength = in.length();
|
174 |
int srclength = in.length();
|
177 |
int sidx = 0;
|
175 |
int sidx = 0;
|