From c53dad98839f5139dcedc128d2545dd2542a7157 Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Tue, 25 May 2004 06:51:43 +0000 Subject: Starting the manual. Oh well. --- doc/code.html | 202 ---------------------------------------------------------- 1 file changed, 202 deletions(-) delete mode 100644 doc/code.html (limited to 'doc/code.html') 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 @@ - - - - -LuaSocket: Network support for the Lua language - - - - - - - -
-
-
- - - -
-LuaSocket -
Network support for the Lua language -
-

-home · -download · -introduction · -reference -

-
-
-
- - - -

Code

- -

-The code.lua module offers routines to convert back and forth -some common types of content encoding, including Base 64 and URL -escaping. Base 64 is described in -RFC -2045, -URL escaping is described in -RFC -2396. -

- - - -

-socket.code.base64(content, single) -

- -

-Applies the Base 64 content coding to a string. -

- -

-Content is the string to be encoded. -If single is set to anything -but nil, the output is returned as a single -line, otherwise the function splits the content into 76 character long -lines after encoding. -

- -

-The function returns the encoded string. -

- -
-code = socket.code.base64("diego:password")
--- code = "ZGllZ286cGFzc3dvcmQ="
-
- - - -

-socket.code.unbase64(content) -

- -

-Removes the Base 64 content coding from a string. -

- -

-Content is the string to be decoded. -

- -

-The function returns the decoded string. -

- - - -

-socket.code.escape(content) -

- -

-Applies the URL escaping content coding to a string -Each byte is encoded as a percent character followed -by the two byte hexadecimal representation of its integer -value. -

- -

-Content is the string to be encoded. -

- -

-The function returns the encoded string. -

- -
-code = socket.code.escape("/#?;")
--- code = "%2f%23%3f%3b"
-
- - - -

-socket.code.unescape(content) -

- -

-Removes the URL escaping content coding from a string. -

- -

-Content is the string to be decoded. -

- -

-The function returns the decoded string. -

- - - -

-socket.code.hexa(content) -

- -

-Applies the hexadecimal content coding to a string. -Each byte is encoded as the byte hexadecimal -representation of its integer value.

-

- -

-Content is the string to be encoded. -

- -

-The function returns the encoded string. -

- -
-code = socket.code.hexa("\16\32\255")
--- code = "1020ff"
-
- - - -

-socket.code.unhexa(content) -

- -

-Removes the hexadecimal content coding from a string. -

- -

-Content is the string to be decoded. -

- -

-The function returns the decoded string. -

- - - - - - - -- cgit v1.2.3-55-g6feb