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)

    	

     



  • 相关阅读:
    asp.net core 使用 StaticFiles 中间件 (不完整翻译)
    asp.net core 通过 TeamCity 实现持续集成笔记
    Swashbuckle for asp.net core 配置说明
    # TypeScript 中如何确保 this 的正确性
    MySql + EF6 + .Net Core
    ASP.NET Core + EF6
    数据库设计 Assignment 02
    NYOJ 8 一种排序
    NYOJ 23.取石子(一)
    邻接表(C++)
  • 原文地址:https://www.cnblogs.com/hannover/p/2328940.html
Copyright © 2011-2022 走看看