/* libzzinet
 *
 * This program is distributed under the GNU General Public License, version 2.
 * A copy of this license is included with this source.
 *
 * Copyright 2000-2006, Toni Thomsson <toni@tonjac.org> 
*/

#ifndef zz_base64_h
#define zz_base64_h

#include <assert.h>

#include <ctype.h>
#include <string.h> 
#include <zz_export.h>

/**
    Base64 algoritm

    @author Toni Thomsson, toni@tonjac.org
*/
class ZZ_API CzzBase64
{
public:

    ~CzzBase64();

    /** 
        Encode base64

        @param dst  Destination buffer
        @param dstlen   Length of the destination buffer
        @param src Source buffer
        @param srclen Length of the source buffer
    */
    static int encode (char *dst, int dstlen, const unsigned char *src, int srclen);
    
    /** 
        Decode base64

        @param dst  Destination buffer
        @param dstlen   Length of the destination buffer
        @param src Source buffer
        @param srclen Length of the source buffer
    */
    static int decode (unsigned char *dst, int dstlen, const char *src, int srclen);

protected:
private:
    CzzBase64();
};

#endif // zz_base64_h