Re: Base64 Encode/Code



OK I've been thinking about this as an Atmus library facility.

Base64 encoding is used to encode arbitrary binary content.

GT.M can operate in two modes M (ASCII) or UTF8.

I suppose what is being asked for is to encode and decode GT.M strings
in either mode.

There are two limitations that come to mind:
1) Encoding a string in one mode (UTF8) and decoding in a different
process running the other mode (ASCII) would not work. ie: bad
translation
2) Encoded strings will be about 33% larger than decoded strings. GT.M
has a string size limit of 1 megabyte. Trying to encode a string over
approximately 750KB will fail.

The facility should be able to detect which mode it is operating in so
you would have two simple extrinsic functions something like:

Set string64=$$zcoreString^Encode64(string)

Set string=$$zcoreString^Decode64(string)

Reading the Base64 entry on Wikipedia:
* There seems to be some variations on the default encoding characters
"+" and "/" depending on this whether one wants to use encoded strings
in URL parameters. ie: negate URL encoding the token. I suppose these
can be detected.
* Variable line length
* Whether to include end padding characters in encoding output

How would you intend to use a base64 encoded string in your program?
Do you wish to inter-operate encoded strings between an Mumps and a
non-Mumps program?
Any objections to a dependency on an existing "Base64" command line
utility to do the encoding and decoding or do you need a mumps
implementation of Base64 encoding? ie: no external dependencies.

Kind regards


Alex

On Oct 23, 2:28 am, mumpscode <mumpsc...@xxxxxxxxxxx> wrote:
Someone has in your library a standard mumps routine that encode /
decode BASE64?

Thanks!

.


Quantcast