Clarion 10 function to Encode/Decode Base64

Hi
I need a function to encode/decode base64 Clarion10 compatible.
Thank you so much !!!

take a look at
SystemStringClass CLASS

Thank you. I will do it.

StringTheory - CapeSoft.com - Does it

Hi !

The simplest, stable and free open source solution is FPRINT:
https://github.com/mikeduglas/printf

BASE64 = printf('%v',STRING)
STRING = printf('%w',BASE64)
2 Likes

Very interesting, I didn’t know about “printf”.
It works very fine !!
Thank you.

Clarion interface to base64, encode/decode

I hope you find it useful.
In my case I am using it and it works correctly.

Thank you. I will try it.

If you search LibSrc for “Base64” you will find a few:

abmime.inc        Base64FileMgr CLASS(FileManager),IMPLEMENTS(IEncoder),TYPE,MODULE('ABMIME.CLW'),LINK('ABMIME.CLW',_MAILinkMode_),DLL(_MAIDllMode_)
abmime.inc        ToBase64 PROCEDURE(STRING In, *STRING Out),SIGNED ! Length encoded
abmime.inc        FromBase64 PROCEDURE(STRING In, *STRING Out),SIGNED ! Length decoded
cpxml.clw         ToBase64 procedure(string inv)
cpxml.clw         FromBase64 procedure(string inv)
cpxml.inc         ToBase64 PROCEDURE(string in), string
cpxml.inc         FromBase64 PROCEDURE(string in), string
systemstring.inc  ToBase64 PROCEDURE(),STRING
systemstring.inc  FromBase64 PROCEDURE(STRING svalue)
systemstring.inc  EncodeBase64 PROCEDURE(BYTE quote=0)
systemstring.inc  DecodeBase64 PROCEDURE(BYTE isQuoted=0)
systemstring.inc  EncodeBase64 PROCEDURE(STRING svalue, BYTE quote=0),STRING
systemstring.inc  DecodeBase64 PROCEDURE(STRING b64sValue, BYTE isQuoted=0),STRING
wbstd.inc         IC:EncodeBase64 PROCEDURE(STRING text),STRING
wbstd.inc         IC:DecodeBase64 PROCEDURE(STRING text),STRING
3 Likes

Connecting CPXML add 2 DLL to the application,
the class is not convenient for simple operations.
We’re not looking for the most difficult or expensive solution, are we?

Good morning !!! Thank you !!

That solution solved my problem ! Thank you.

Cpxml.clw has a local implementation of ToBase64 and FromBase64 that does not rely on the CP DLL’s.

I suggested those LibSrc files as they have the source code to Base 64 Encode/Decode that could be added to one’s APP so have no dependency on any other library and be modified to fit the exact need.