mirror of
https://github.com/anatolykopyl/know-own-checksum.git
synced 2026-03-26 12:55:27 +00:00
Initial commit
This commit is contained in:
19
i_know_my_md5.lua
Normal file
19
i_know_my_md5.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
local md5 = require 'md5'
|
||||
local this_file = 'i_know_my_md5.lua'
|
||||
|
||||
function read_all(file)
|
||||
local f = assert(io.open(file, "rb"))
|
||||
local content = f:read("*all")
|
||||
f:close()
|
||||
return content
|
||||
end
|
||||
|
||||
local content = read_all(this_file)
|
||||
local md5_result = md5.sumhexa(content)
|
||||
local md5_expected = ''
|
||||
|
||||
print('My expected md5 checksum is ' .. md5_expected)
|
||||
print('My own md5 checksum is ' .. md5_result)
|
||||
|
||||
local match = md5_result == md5_expected
|
||||
return match
|
||||
Reference in New Issue
Block a user