forked from Openarl/PathOfBuilding
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhashTest.lua
More file actions
36 lines (22 loc) · 749 Bytes
/
hashTest.lua
File metadata and controls
36 lines (22 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
local sha1 = require("lua/sha1")
local fileW = io.open("lua_MD5xml.txt", "w+b")
local path="./"
for line in io.lines("luafiles.txt") do
local fileR = io.open(path..line, "rb")
print(line)
local content = fileR:read("*a")
fileR:close()
fileW:write("<File sha1=\""..sha1(content).."\" name=\""..line.."\" part=\"program\"/>\r\n")
fileW:flush()
end
fileW:close()
fileW = io.open("lua_MD5xml2.txt", "w+b")
for line in io.lines("luafiles2.txt") do
local fileR = io.open(path..line, "rb")
print(line)
local content = fileR:read("*a")
fileR:close()
fileW:write("<File sha1=\""..sha1(content).."\" name=\""..line.."\" part=\"runtime\"/>\r\n")
fileW:flush()
end
fileW:close()