aboutsummaryrefslogtreecommitdiff
path: root/doc/code.html
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-05-25 06:51:43 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-05-25 06:51:43 +0000
commitc53dad98839f5139dcedc128d2545dd2542a7157 (patch)
treef50f3aaae16eb8f7001037b1d70b0b7b5f7ee0b6 /doc/code.html
parent5c13076f8936ae6face0779f75c7e6f148e4989e (diff)
downloadluasocket-c53dad98839f5139dcedc128d2545dd2542a7157.tar.gz
luasocket-c53dad98839f5139dcedc128d2545dd2542a7157.tar.bz2
luasocket-c53dad98839f5139dcedc128d2545dd2542a7157.zip
Starting the manual. Oh well.
Diffstat (limited to 'doc/code.html')
-rw-r--r--doc/code.html202
1 files changed, 0 insertions, 202 deletions
diff --git a/doc/code.html b/doc/code.html
deleted file mode 100644
index 4668b7a..0000000
--- a/doc/code.html
+++ /dev/null
@@ -1,202 +0,0 @@
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
3<html>
4
5<head>
6<title>LuaSocket: Network support for the Lua language</title>
7<link rel="stylesheet" href="reference.css" type="text/css">
8</head>
9
10<body>
11
12<!-- header +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
13
14<div class=header>
15<hr>
16<center>
17<table summary="LuaSocket logo">
18<tr><td align=center><a href="http://www.lua.org">
19<img border=0 alt="LuaSocket" src="luasocket.png">
20</a></td></tr>
21<tr><td align=center valign=top>Network support for the Lua language
22</td></tr>
23</table>
24<p class=bar>
25<a href="home.html">home</a> &middot;
26<a href="home.html#download">download</a> &middot;
27<a href="introduction.html">introduction</a> &middot;
28<a href="reference.html">reference</a>
29</p>
30</center>
31<hr>
32</div>
33
34<!-- code +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
35
36<h2 id=code>Code</h2>
37
38<p>
39The <tt>code.lua</tt> module offers routines to convert back and forth
40some common types of content encoding, including Base 64 and URL
41escaping. Base 64 is described in
42<a href="http://www.cs.princeton.edu/~diego/rfc/rfc2045.txt">RFC
432045</a>,
44URL escaping is described in
45<a href="http://www.cs.princeton.edu/~diego/rfc/rfc2396.txt">RFC
462396</a>.
47</p>
48
49<!-- base64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
50
51<p class=name id="base64">
52socket.code.<b>base64(</b>content, single<b>)</b>
53</p>
54
55<p class=description>
56Applies the Base 64 content coding to a string.
57</p>
58
59<p class=parameters>
60<tt>Content</tt> is the string to be encoded.
61If <tt>single</tt> is set to anything
62but <b><tt>nil</tt></b>, the output is returned as a single
63line, otherwise the function splits the content into 76 character long
64lines after encoding.
65</p>
66
67<p class=result>
68The function returns the encoded string.
69</p>
70
71<pre class=example>
72code = socket.code.base64("diego:password")
73-- code = "ZGllZ286cGFzc3dvcmQ="
74</pre>
75
76<!-- unbase64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
77
78<p class=name id="unbase64">
79socket.code.<b>unbase64(</b>content<b>)</b>
80</p>
81
82<p class=description>
83Removes the Base 64 content coding from a string.
84</p>
85
86<p class=parameters>
87<tt>Content</tt> is the string to be decoded.
88</p>
89
90<p class=result>
91The function returns the decoded string.
92</p>
93
94<!-- escape +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
95
96<p class=name id="escape">
97socket.code.<b>escape(</b>content<b>)</b>
98</p>
99
100<p class=description>
101Applies the URL escaping content coding to a string
102Each byte is encoded as a percent character followed
103by the two byte hexadecimal representation of its integer
104value.
105</p>
106
107<p class=parameters>
108<tt>Content</tt> is the string to be encoded.
109</p>
110
111<p class=result>
112The function returns the encoded string.
113</p>
114
115<pre class=example>
116code = socket.code.escape("/#?;")
117-- code = "%2f%23%3f%3b"
118</pre>
119
120<!-- unescape +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
121
122<p class=name id="unescape">
123socket.code.<b>unescape(</b>content<b>)</b>
124</p>
125
126<p class=description>
127Removes the URL escaping content coding from a string.
128</p>
129
130<p class=parameters>
131<tt>Content</tt> is the string to be decoded.
132</p>
133
134<p class=return>
135The function returns the decoded string.
136</p>
137
138<!-- hexa +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
139
140<p class=name id="hexa">
141socket.code.<b>hexa(</b>content<b>)</b>
142</p>
143
144<p class=description>
145Applies the hexadecimal content coding to a string.
146Each byte is encoded as the byte hexadecimal
147representation of its integer value. <p>
148</p>
149
150<p class=parameters>
151<tt>Content</tt> is the string to be encoded.
152</p>
153
154<p class=return>
155The function returns the encoded string.
156</p>
157
158<pre class=example>
159code = socket.code.hexa("\16\32\255")
160-- code = "1020ff"
161</pre>
162
163<!-- unhexa +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
164
165<p class=name id="unhexa">
166socket.code.<b>unhexa(</b>content<b>)</b>
167</p>
168
169<p class=description>
170Removes the hexadecimal content coding from a string.
171</p>
172
173<p class=parameters>
174<tt>Content</tt> is the string to be decoded.
175</p>
176
177<p class=return>
178The function returns the decoded string.
179</p>
180
181<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
182
183<div class=footer>
184<hr>
185<center>
186<p class=bar>
187<a href="home.html">home</a> &middot;
188<a href="home.html#down">download</a> &middot;
189<a href="introduction.html">introduction</a> &middot;
190<a href="reference.html">reference</a>
191</p>
192<p>
193<small>
194Last modified by Diego Nehab on <br>
195Sat Aug 9 01:00:41 PDT 2003
196</small>
197</p>
198</center>
199</div>
200
201</body>
202</html>