The s-base64 Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The s-base64 Reference Manual

This is the s-base64 Reference Manual, version 2, generated automatically by Declt version 2.3 "Robert April" on Tue Feb 20 09:18:38 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

S-BASE64

A Common Lisp implementation of Base64 Encoding/Decoding

S-BASE64 is an open source Common Lisp implementation of Base64 encoding and decoding. Base64 encoding is a technique to encode binary data in a portable, safe printable, 7-bit ASCII format. For a general introduction, please consult the Wikipedia article on Base64.

This simple package is used as a building block in a number of other open source projects e.g. the KPAX web development framework.

Contents

Features

S-BASE64 can:

Status

S-BASE64 is considered stable code.

News

October 2005 - Created as a separate project.

Platforms

S-BASE64 is written in ANSI standard Common Lisp and should be portable across any CL implementation.

Installation

The S-BASE64 package is loaded using ASDF. There is an excellent tutorial on ASDF to get you started.

$ cd apps/asdf/systems/
$ ln -s ~/darcs/s-base64/s-base64.asd .
$ cd ~
$ /Applications/LispWorks/lispworks-tty 
LispWorks(R): The Common Lisp Programming Environment
Copyright (C) 1987-2005 LispWorks Ltd.  All rights reserved.
Version 4.4.5
Saved by sven as lispworks-tty, at 26 Oct 2005 11:53
User sven on voyager.local
; Loading text file /Applications/LispWorks/Library/lib/4-4-0-0/config/siteinit.lisp
;  Loading text file /Applications/LispWorks/Library/lib/4-4-0-0/private-patches/load.lisp
; Loading text file /Users/sven/.lispworks
;  Loading text file /Users/sven/apps/asdf/init-asdf.lisp
;   Loading fasl file /Users/sven/apps/asdf/asdf.nfasl
;Pushed #P"/Users/sven/apps/asdf/systems/" onto ASDF central registry

CL-USER 1 > (asdf:oos 'asdf:load-op :s-base64)
; Loading /Applications/LispWorks/Library/lib/4-4-0-0/load-on-demand/ccl/xp-fancyformat.nfasl on demand...
; loading system definition from
; /Users/sven/apps/asdf/systems/s-base64.asd into
; #<The ASDF787 package, 0/16 internal, 0/16 external>
; Loading text file /Users/sven/darcs/s-base64/s-base64.asd
; registering # as S-BASE64
;;; Compiling file /Users/sven/darcs/s-base64/src/package.lisp ...
...
; Loading fasl file /Users/sven/darcs/s-base64/src/package.nfasl
;;; Compiling file /Users/sven/darcs/s-base64/src/base64.lisp ...
...
; Loading fasl file /Users/sven/darcs/s-base64/src/base64.nfasl

Example of setting up and using ASDF to compile and load the package

Usage

To encode you start with either a binary input stream or a byte array and write to a character output stream. To decode you start from a character input stream and write to a binary output stream or return a byte array. You can use the standard CL marcros WITH-OUTPUT-TO-STRING of WITH-INPUT-FROM-STRING to convert to and from a string. The following listener transcript show how to compute the second example from RFC 3548, section 7:

CL-USER 1 > (in-package :s-base64)
#<The S-BASE64 package, 50/128 internal, 4/16 external>

S-BASE64 2 > (setf bytes #(#x14 #xfb #x9c #x03 #xd9))
#(20 251 156 3 217)

S-BASE64 3 > (with-output-to-string (out) 
               (encode-base64-bytes bytes out))
"FPucA9k="

S-BASE64 4 > (with-input-from-string (in *)
               (decode-base64-bytes in))
#(20 251 156 3 217)

Example Base64 Encoding and Decoding

API Reference

There is automatically generated API Referencedocumentation available for the S-BASE64 package in doc/API.html.

Mailinglist

The KPAX mailing list is used for this project.

Changelog

Release Notes:

TODO

There is a variant of Base64 encoding used for URL's and filenames that could be implemented.

FAQ

Nothing appropriate.

Bugs

Illegal input results in generic low-level CL conditions rather than a more meaningful high-level application specific condition.

Authors

S-BASE64 was written by Sven Van Caekenberghe.

Maintainers

S-BASE64 is being maintained by Sven Van Caekenberghe.

License

You are granted the rights to distribute and use this software as governed by the terms of the Lisp Lesser General Public License (http://opensource.franz.com/preamble.html), also known as the LLGPL.

History

S-BASE64 was originally part of KPAX and became a separate project in October 2005.

References

The following RFC's can be considered as definitions of Base64 Encoding:

Copyright © 2002-2006 Sven Van Caekenberghe, Beta Nine BVBA. All Right Reserved


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 s-base64

Maintainer

Sven Van Caekenberghe <svc@mac.com>

Author

Sven Van Caekenberghe <svc@mac.com>

License

Lesser Lisp General Public License (LLGPL)

Description

Common Lisp Base64 Package

Long Description

S-BASE64 is a Common Lisp implementation of Base64 Encoding/Decoding

Version

2

Source

s-base64.asd (file)

Component

src (module)


Next: , Previous: , Up: Top   [Contents][Index]

3 Modules

Modules are listed depth-first from the system components tree.


Previous: , Up: Modules   [Contents][Index]

3.1 s-base64/src

Parent

s-base64 (system)

Location

src/

Components

Next: , Previous: , Up: Top   [Contents][Index]

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

4.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.1 s-base64.asd

Location

s-base64.asd

Systems

s-base64 (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.2 s-base64/src/package.lisp

Parent

src (module)

Location

src/package.lisp

Packages

s-base64


Previous: , Up: Lisp files   [Contents][Index]

4.1.3 s-base64/src/base64.lisp

Dependency

package.lisp (file)

Parent

src (module)

Location

src/base64.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

5.1 s-base64

An implementation of standard Base64 encoding and decoding

Source

package.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

6.1 Exported definitions


Previous: , Up: Exported definitions   [Contents][Index]

6.1.1 Functions

Function: decode-base64 IN OUT

Decode a base64 encoded character input stream into a binary output stream

Package

s-base64

Source

base64.lisp (file)

Function: decode-base64-bytes STREAM

Decode a base64 encoded character stream, returns a byte array

Package

s-base64

Source

base64.lisp (file)

Function: encode-base64 IN OUT &optional BREAK-LINES

Encode a binary input stream into a base64 encoded character output stream

Package

s-base64

Source

base64.lisp (file)

Function: encode-base64-bytes ARRAY STREAM &optional BREAK-LINES

Encode a byte array into a base64 encoded character stream

Package

s-base64

Source

base64.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

6.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.1 Special variables

Special Variable: +base64-alphabet+
Package

s-base64

Source

base64.lisp (file)

Special Variable: +inverse-base64-alphabet+
Package

s-base64

Source

base64.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

6.2.2 Functions

Function: core-decode-base64 CHAR1 CHAR2 CHAR3 CHAR4
Package

s-base64

Source

base64.lisp (file)

Function: core-encode-base64 BYTE1 BYTE2 BYTE3
Package

s-base64

Source

base64.lisp (file)

Function: skip-base64-whitespace STREAM
Package

s-base64

Source

base64.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   M   S  
Index Entry  Section

F
File, Lisp, s-base64.asd: The s-base64<dot>asd file
File, Lisp, s-base64/src/base64.lisp: The s-base64/src/base64<dot>lisp file
File, Lisp, s-base64/src/package.lisp: The s-base64/src/package<dot>lisp file

L
Lisp File, s-base64.asd: The s-base64<dot>asd file
Lisp File, s-base64/src/base64.lisp: The s-base64/src/base64<dot>lisp file
Lisp File, s-base64/src/package.lisp: The s-base64/src/package<dot>lisp file

M
Module, s-base64/src: The s-base64/src module

S
s-base64.asd: The s-base64<dot>asd file
s-base64/src: The s-base64/src module
s-base64/src/base64.lisp: The s-base64/src/base64<dot>lisp file
s-base64/src/package.lisp: The s-base64/src/package<dot>lisp file

Jump to:   F   L   M   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   C   D   E   F   S  
Index Entry  Section

C
core-decode-base64: Internal functions
core-encode-base64: Internal functions

D
decode-base64: Exported functions
decode-base64-bytes: Exported functions

E
encode-base64: Exported functions
encode-base64-bytes: Exported functions

F
Function, core-decode-base64: Internal functions
Function, core-encode-base64: Internal functions
Function, decode-base64: Exported functions
Function, decode-base64-bytes: Exported functions
Function, encode-base64: Exported functions
Function, encode-base64-bytes: Exported functions
Function, skip-base64-whitespace: Internal functions

S
skip-base64-whitespace: Internal functions

Jump to:   C   D   E   F   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   +  
S  
Index Entry  Section

+
+base64-alphabet+: Internal special variables
+inverse-base64-alphabet+: Internal special variables

S
Special Variable, +base64-alphabet+: Internal special variables
Special Variable, +inverse-base64-alphabet+: Internal special variables

Jump to:   +  
S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   P   S  
Index Entry  Section

P
Package, s-base64: The s-base64 package

S
s-base64: The s-base64 system
s-base64: The s-base64 package
System, s-base64: The s-base64 system

Jump to:   P   S