You are looking at historical revision 32807 of this page. It may differ significantly from its current revision.

Outdated egg!

This is an egg for CHICKEN 3, the unsupported old release. You're almost certainly looking for the CHICKEN 4 version of this egg, if it exists.

If it does not exist, there may be equivalent functionality provided by another egg; have a look at the egg index. Otherwise, please consider porting this egg to the current version of CHICKEN.

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)

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)

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

Examples

Encoding a stream

(use stream-base64)

; Encode everything from current-input-port and write it:
(write-stream
  (base64-encode
    (port->stream
      (current-input-port))))

Decoding a stream

(use stream-base64)

; Decode everything from current-input-port and write it:
(write-stream
  (base64-decode
    (port->stream
      (current-input-port))))

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.