Base 64 encoder/decoder for Lotus script

Source: Internet
Author: User
Tags http authentication
ArticleDirectory
    • Samples

This an implementation of base64 as described in rfc4648 (the base16, base32, and base64 data encodings) for the Lotus Notes environment.

Base64 is an algorithm to encode binary data into a ASCII text representation. common applications are

    • Passing credentials to Web servers: HTTP Authentication: basic and digest access authentication.
    • Transferring binary data in Email: For this purpose, the encoding can be run in mime-mode to produce line breaks.
    • Transferring or storing binary data in other formats, like XML.

This library makes use of notesstreams and notesmimeentity that came with Notes 6.

Usage
    1. Save and unzip the code to a text file (libbase64.lss)
    2. Use Domino designer to create a new empty Lotus script library 'libbase64 ′
    3. Import libbase64.lss and save the Lib
    4. Now you can include the Library (Use "libbase64") And use it:
      Dim b64 as new cbase64 ()
      Call b64.encode (..)
Samples

 

Encode a string to base64

Dim b64 as new cbase64 ()

 
Print b64.encodestring ("foobar ")
Encode a binary file to a base64 encoded file

Dim b64 as new cbase64 ()

 
Call b64.encodefiletofile (fspecinput, fspecoutput)

The result file will have line breaks at column 76. If this is not desired, than it can be suppressed. This will be a bit slower however:

 
Dim b64 as new cbase64 () b64.bmimemodeencoding = falsecall b64.encodefiletofile (fspecinput, fspecoutput)

Decode a base64 encoded file to a (probably binary) File

Dim b64 as new cbase64 ()

Call b64.decodefiletofile (fspecinput, fspecoutput)

 
 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.