zoukankan      html  css  js  c++  java
  • Base 64 encoder/decoder for Lotus Script

    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 = False
    	Call b64.encodeFileToFile (fspecInput, fspecOutput)
    	

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

    Dim b64 As New CBase64()

    Call b64.decodeFileToFile (fspecInput, fspecOutput)

    	

     



  • 相关阅读:
    druid连接池的配置和应用
    Maven的Unknow错误
    实践——WebStorm安装(2021/01/30)(更新2021/07/14,添加激活码和习惯设置)
    vue3如何编写挂载DOM的插件
    npm 安装源
    一个node项目的docker镜像制作
    圣女
    基于计算机视觉的车牌识别系统(一)
    vue3 兄弟组件传参mitt
    laravel-admin 加载样式失败
  • 原文地址:https://www.cnblogs.com/hannover/p/2328940.html
Copyright © 2011-2022 走看看