summaryrefslogtreecommitdiff
path: root/tex/context/base/l-md5.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2012-12-06 01:21:00 +0100
committerHans Hagen <pragma@wxs.nl>2012-12-06 01:21:00 +0100
commitaa7af748bc475891fb91683ea1708f6db79cfbb0 (patch)
treed926a40eee9feba9625fdaa71cae3def0b62a3c7 /tex/context/base/l-md5.lua
parent5843319486b908403bd682c57f5b446b31dd121f (diff)
downloadcontext-aa7af748bc475891fb91683ea1708f6db79cfbb0.tar.gz
beta 2012.12.06 01:21
Diffstat (limited to 'tex/context/base/l-md5.lua')
-rw-r--r--tex/context/base/l-md5.lua43
1 files changed, 31 insertions, 12 deletions
diff --git a/tex/context/base/l-md5.lua b/tex/context/base/l-md5.lua
index 6abf2e17d..a60e4f575 100644
--- a/tex/context/base/l-md5.lua
+++ b/tex/context/base/l-md5.lua
@@ -18,18 +18,37 @@ if not md5.HEX then function md5.HEX(str) return convert(str,"%02X") end end
if not md5.hex then function md5.hex(str) return convert(str,"%02x") end end
if not md5.dec then function md5.dec(str) return convert(str,"%03i") end end
---~ if not md5.HEX then
---~ local function remap(chr) return format("%02X",byte(chr)) end
---~ function md5.HEX(str) return (gsub(md5.sum(str),".",remap)) end
---~ end
---~ if not md5.hex then
---~ local function remap(chr) return format("%02x",byte(chr)) end
---~ function md5.hex(str) return (gsub(md5.sum(str),".",remap)) end
---~ end
---~ if not md5.dec then
---~ local function remap(chr) return format("%03i",byte(chr)) end
---~ function md5.dec(str) return (gsub(md5.sum(str),".",remap)) end
---~ end
+-- local P, Cs, lpegmatch = lpeg.P, lpeg.Cs,lpeg.match
+--
+-- if not md5.HEX then
+-- local function remap(chr) return format("%02X",byte(chr)) end
+-- function md5.HEX(str) return (gsub(md5.sum(str),".",remap)) end
+-- end
+--
+-- if not md5.hex then
+-- local function remap(chr) return format("%02x",byte(chr)) end
+-- function md5.hex(str) return (gsub(md5.sum(str),".",remap)) end
+-- end
+--
+-- if not md5.dec then
+-- local function remap(chr) return format("%03i",byte(chr)) end
+-- function md5.dec(str) return (gsub(md5.sum(str),".",remap)) end
+-- end
+
+-- if not md5.HEX then
+-- local pattern_HEX = Cs( ( P(1) / function(chr) return format("%02X",byte(chr)) end)^0 )
+-- function md5.HEX(str) return lpegmatch(pattern_HEX,md5.sum(str)) end
+-- end
+--
+-- if not md5.hex then
+-- local pattern_hex = Cs( ( P(1) / function(chr) return format("%02x",byte(chr)) end)^0 )
+-- function md5.hex(str) return lpegmatch(pattern_hex,md5.sum(str)) end
+-- end
+--
+-- if not md5.dec then
+-- local pattern_dec = Cs( ( P(1) / function(chr) return format("%02i",byte(chr)) end)^0 )
+-- function md5.dec(str) return lpegmatch(pattern_dec,md5.sum(str)) end
+-- end
function file.needsupdating(oldname,newname,threshold) -- size modification access change
local oldtime = lfs.attributes(oldname,"modification")