This repository has been archived by the owner on Nov 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[luadist-git] add lbase64-5.1-Windows-x86
- Loading branch information
0 parents
commit e09d915
Showing
4 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
type = "x86" | ||
arch = "Windows" | ||
author = "Luiz Henrique de Figueiredo" | ||
depends = { | ||
[[lua ~> 5.1]], | ||
} | ||
|
||
desc = "A Base64 library for Lua" | ||
version = "5.1" | ||
maintainer = "Peter Drahoš" | ||
files = { | ||
Runtime = { | ||
[[lib\lua\base64.dll]], | ||
} | ||
, | ||
Data = { | ||
[[share\lbase64\README]], | ||
} | ||
, | ||
Test = { | ||
[[share\lbase64\test\test.lua]], | ||
} | ||
, | ||
} | ||
|
||
url = "http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lbase64" | ||
name = "lbase64" | ||
license = "Public domain" |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
This is a base64 library for Lua 5.1. For information on base64 see | ||
http://en.wikipedia.org/wiki/Base64 | ||
|
||
To try the library, just edit Makefile to reflect your installation of Lua and | ||
then run make. This will build the library and run a simple test. For detailed | ||
installation instructions, see | ||
http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/install.html | ||
|
||
There is no manual but the library is simple and intuitive; see the summary | ||
below. Read also test.lua, which shows the library in action. | ||
|
||
This code is hereby placed in the public domain. | ||
Please send comments, suggestions, and bug reports to lhf@tecgraf.puc-rio.br . | ||
|
||
------------------------------------------------------------------------------- | ||
|
||
base64 library: | ||
decode(s) encode(s) version | ||
|
||
------------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
-- test base64 library | ||
|
||
require"base64" | ||
|
||
print(base64.version) | ||
print"" | ||
|
||
function test(s) | ||
local a=base64.encode(s) | ||
local b=base64.decode(a) | ||
print(string.len(s),b==s,a,s) | ||
assert(b==s) | ||
end | ||
|
||
for i=0,9 do | ||
local s=string.sub("Lua-scripting-language",1,i) | ||
test(s) | ||
end | ||
|
||
function test(p) | ||
print("testing prefix "..string.len(p)) | ||
for i=0,255 do | ||
local s=p..string.char(i) | ||
local a=base64.encode(s) | ||
local b=base64.decode(a) | ||
assert(b==s,i) | ||
end | ||
end | ||
|
||
print"" | ||
test"" | ||
test"x" | ||
test"xy" | ||
test"xyz" | ||
|
||
print"" | ||
s="Lua-scripting-language" | ||
a=base64.encode(s) | ||
b=base64.decode(a) | ||
print(a,b,string.len(b)) | ||
|
||
a=base64.encode(s) | ||
a=string.gsub(a,"[A-Z]","?") | ||
b=base64.decode(a) | ||
print(a,b) | ||
|
||
a=base64.encode(s) | ||
a=string.gsub(a,"[a-z]","?") | ||
b=base64.decode(a) | ||
print(a,b) | ||
|
||
a=base64.encode(s) | ||
a=string.gsub(a,"[A-Z]","=") | ||
b=base64.decode(a) | ||
print(a,b,string.len(b)) | ||
|
||
a=base64.encode(s) | ||
a=string.gsub(a,"[a-z]","=") | ||
b=base64.decode(a) | ||
print(a,b,string.len(b)) | ||
|
||
print"" | ||
print(base64.version) | ||
|
||
-- eof |