source: project/wiki/stream-base64 @ 9678

Last change on this file since 9678 was 9678, checked in by sjamaan, 12 years ago

Update stream-base64

File size: 1.2 KB
Line 
1[[tags: eggs streams base64 parsing]]
2
3== stream-base64
4
5[[toc:]]
6
7=== Author
8
9Alejandro Forero Cuervo
10
11=== Documentation
12
13The stream-base64 egg allows you to encode and decode streams of bytes in base64.
14
15<procedure>(base64-decode stream)</procedure>
16
17Returns a stream of characters with the contents of {{stream}} after
18decoding them.  {{stream}} should be a stream of characters encoded in
19Base64.
20
21<procedure>(base64-encode stream)</procedure>
22
23Returns a stream of characters with the contents of
24{{stream}} encoded in Base64.
25
26
27=== Examples
28
29==== Encoding a stream
30
31<example>
32<init>(use stream-base64)</init>
33<expr>
34; Encode everything from current-input-port and write it:
35(write-stream
36  (base64-encode
37    (port->stream
38      (current-input-port))))
39</expr>
40</example>
41
42==== Decoding a stream
43
44<example>
45<init>(use stream-base64)</init>
46<expr>
47; Decode everything from current-input-port and write it:
48(write-stream
49  (base64-decode
50    (port->stream
51      (current-input-port))))
52</expr>
53</example>
54
55=== Changelog
56
57* 1.1 - added .setup script (felix)
58* 1.0 (r1578) - First public release.
59
60=== License
61
62The Base64 egg for Chicken Scheme is in the public domain and may be
63reproduced or copied without permission from its author.  Citation of
64the source is appreciated.
Note: See TracBrowser for help on using the repository browser.