websDecode64 GoAhead WebServer API GoAhead EMF

Synopsis

Decode a string using the basic encoding scheme (base 64)

Prototype

#include "webs.h"

int websDecode64(char_t *outbuf, char_t *string, int outlen);

Parameters

outbuf Output buffer
string Input string
outlen Output buffer length

Description

The websDecode64 procedure decodes the string argument into the supplied outbuf buffer. websDecode64 can decode in-situ. Ie. outbuf and string can be the same.

Return Value

Returns 0 if successful. Returns -1 if the string was not a valid base 64 encoded string.

Example

websEncode64(encoded, "String with special characters \" %", 
    sizeof(encoded));
websDecode64(decoded, encoded, sizeof(decoded));

See Also

websEncode64