From 3857fee1017e8dec164faa13a0ca01828b4d50f6 Mon Sep 17 00:00:00 2001 From: Mike Mason Date: Mon, 4 Feb 2008 21:07:39 +0000 Subject: 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 --- lib/format.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lib/format.lua') 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 -- cgit v1.2.3