summaryrefslogtreecommitdiffstats
path: root/lib/format.lua
diff options
context:
space:
mode:
authorMike Mason <ms13sp@gmail.com>2008-02-04 21:07:39 +0000
committerMike Mason <ms13sp@gmail.com>2008-02-04 21:07:39 +0000
commit3857fee1017e8dec164faa13a0ca01828b4d50f6 (patch)
tree6c5ca2101122aeaf61e18c865d4fa91eaa902a71 /lib/format.lua
parent30e76e234af48b3c42e1e22eae2ebb25dd3625f6 (diff)
downloadacf-core-3857fee1017e8dec164faa13a0ca01828b4d50f6.tar.bz2
acf-core-3857fee1017e8dec164faa13a0ca01828b4d50f6.tar.xz
Adding the beingings of the authorization items. Also adding some of the updates to the Autentication.
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@689 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'lib/format.lua')
-rw-r--r--lib/format.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/format.lua b/lib/format.lua
index 1fa5fc6..2865756 100644
--- a/lib/format.lua
+++ b/lib/format.lua
@@ -31,7 +31,8 @@ function remove_blanks_comments ( path )
end
local lines = {}
for a,b in ipairs(f) do
- local c = string.match(b, "^$") or string.match(b, "^%#")
+ local c = string.match(b, "^$") or string.match(b, "^%#")
+ --this does not take care of lua comments with -- or --[[
if c == nil then lines[#lines + 1] = b end
end
-- returns a table to iterate over without the blank or commented lines
@@ -148,3 +149,13 @@ function string_to_table ( text, delimiter)
return list
end
+function md5sum_string ( str)
+ cmd = "/bin/echo -n " .. str .. "|/usr/bin/md5sum|cut -f 1 -d \" \" "
+ f = io.popen(cmd)
+ local checksum = {}
+ for line in f:lines() do
+ checksum[#checksum + 1] = line
+ end
+ f:close()
+ return checksum[1]
+end