Note: This is taken from the Chicken Wiki, where a more recent version could be available.

stream-base64

Author

Alejandro Forero Cuervo

Documentation

The stream-base64 egg allows you to encode and decode streams of bytes in base64.

<procedure>(base64-decode stream)</procedure>

Returns a stream of characters with the contents of stream after decoding them. stream should be a stream of characters encoded in Base64.

<procedure>(base64-encode stream)</procedure>

Returns a stream of characters with the contents of stream encoded in Base64.

Examples

Encoding a stream

<examples><example> <init>(use stream-base64)</init> <expr> ; Encode everything from current-input-port and write it: (write-stream

 (base64-encode
   (port->stream
     (current-input-port))))

</expr> </example></examples>

Decoding a stream

<examples><example> <init>(use stream-base64)</init> <expr> ; Decode everything from current-input-port and write it: (write-stream

 (base64-decode
   (port->stream
     (current-input-port))))

</expr> </example></examples>

Changelog

License

The Base64 egg for Chicken Scheme is in the public domain and may be reproduced or copied without permission from its author. Citation of the source is appreciated.