source: project/wiki/eggref/4/base64 @ 12512

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

Move and copy some egg reference docs to the eggref/4 docs

File size: 2.2 KB
Line 
1[[tags:eggs]]
2[[toc:]]
3
4== Description
5
6Parsing and unparsing of base64 strings.
7
8== Documentation
9
10 '''procedure:''' (encode STRING)
11
12Returns {{STRING}} encoded as base64 text (a string).
13
14 '''procedure:''' (decode STRING)
15
16Returns the decoded string from the base64 data {{STRING}}.
17
18== Examples
19
20<example>
21<init>
22(require-library base64)
23(import (prefix base64 base64:))
24</init>
25<expr>
26(define s "thequickbrownfoxjumpsoverthelazydog")
27(base64:encode s)
28</expr>
29<result>
30"dGhlcXVpY2ticm93bmZveGp1bXBzb3ZlcnRoZWxhenlkb2c="
31</result>
32<expr>
33(base64:decode (base64:encode s))
34</expr>
35<result>
36"thequickbrownfoxjumpsoverthelazydog"
37</result>
38</example>
39
40== About this egg
41
42=== Author
43
44* James Bailey, ported to CHICKEN by felix
45* Converted to C by [[http://3e8.org/zb|Zbigniew]]
46
47=== Version history
48
49; 2.2 : Fix encoding problem with chars > 127 [zb]
50; 2.1 : Ported to hygienic Chicken [[[Peter Bex]]]
51; 2.0 : Reimplemented in C for large speedup. [zbigniew]
52; 1.3 : Replaced implementation with a much faster version by James Bailey
53; 1.2 : Removed read syntax
54; 1.1 : Decoding accepts whitespace now.
55; 1.0 : Initial release.
56
57=== License
58
59 Copyright (c) 2004 James Bailey.
60 Copyright (c) 2008 Jim Ursetto.
61 
62 Permission is hereby granted, free of charge, to any person obtaining a
63 copy of this software and associated documentation files (the "Software"),
64 to deal in the Software without restriction, including without limitation
65 the rights to use, copy, modify, merge, publish, distribute, sublicense,
66 and/or sell copies of the Software, and to permit persons to whom the
67 Software is furnished to do so, subject to the following conditions:
68 
69 The above copyright notice and this permission notice shall be included in
70 all copies or substantial portions of the Software.
71 
72 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
73 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
74 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
75 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
76 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
77 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
78 DEALINGS IN THE SOFTWARE.
79
Note: See TracBrowser for help on using the repository browser.