conversion/base64.bi

Summary
conversion/base64.bi
LicenseCopyright © 2007-2012, FreeBASIC Extended Library Development Group Contains code contributed and Copyright © 2007, Daniel Verkamp (DrV) http://drv.nu
ext.conversion.base64
Functions
encodeEncodes data into base64
encodeEncodes data into base64
decodeDecodes base64 encoded data into its raw binary form.
decodeDecodes a base64 encoded string into a unencoded string.
decoded_lengthGives the decoded length of a base64 encoded buffer for sizing the destination buffer.

License

Copyright © 2007-2012, FreeBASIC Extended Library Development Group Contains code contributed and Copyright © 2007, Daniel Verkamp (DrV) http://drv.nu

Distributed under the FreeBASIC Extended Library Group license.  See accompanying file LICENSE.txt or copy at http://code.google.com/p/fb-extended-lib/wiki/License

ext.conversion.base64

Summary
Functions
encodeEncodes data into base64
encodeEncodes data into base64
decodeDecodes base64 encoded data into its raw binary form.
decodeDecodes a base64 encoded string into a unencoded string.
decoded_lengthGives the decoded length of a base64 encoded buffer for sizing the destination buffer.

Functions

encode

declare function encode overload (byval src as const ubyte ptr,
byval s_l as ext.SizeType) as string

Encodes data into base64

Parameters

sourcepointer to the raw data to be encoded
source_lenthe size of the source data

Returns

A base64 encoded representation of the data.

encode

declare function encode overload (byref src as const string) as string

Encodes data into base64

Parameters

sourcestring to be encoded

Returns

A base64 encoded representation of the data.

decode

declare sub decode overload (byval dest as ubyte ptr,
byval source as const ubyte ptr,
byval source_length as ext.SizeType)

Decodes base64 encoded data into its raw binary form.

Parameters

destubyte ptr where data will go.
sourcepointer to base64 encode data.
source_lengththe length in bytes of the source data.

decode

declare sub decode overload (byref dest as string,
byref source as const string)

Decodes a base64 encoded string into a unencoded string.

Parameters

deststring where decoded data will go.
sourcestring holding encoded data.

decoded_length

declare function decoded_length (
   byval source_length as ext.SizeType
) as ext.SizeType

Gives the decoded length of a base64 encoded buffer for sizing the destination buffer.

Parameters

source_lengthuinteger containing the length of the source in bytes.

Returns

uinteger containing the total length of the raw data.

declare function encode overload (byval src as const ubyte ptr,
byval s_l as ext.SizeType) as string
Encodes data into base64
declare sub decode overload (byval dest as ubyte ptr,
byval source as const ubyte ptr,
byval source_length as ext.SizeType)
Decodes base64 encoded data into its raw binary form.
declare function decoded_length (
   byval source_length as ext.SizeType
) as ext.SizeType
Gives the decoded length of a base64 encoded buffer for sizing the destination buffer.