crc32 is a number

This commit is contained in:
2021-10-30 21:33:28 +03:00
parent 54f368e205
commit d3b23d2f89
3 changed files with 10 additions and 10 deletions

View File

@@ -2,15 +2,15 @@ local crc32 = require 'crc32'
local this_file = 'i_know_my_crc32.lua'
function read_all(file)
local f = assert(io.open(file, "rb"))
local content = f:read("*all")
f:close()
return content
local f = assert(io.open(file, "rb"))
local content = f:read("*all")
f:close()
return content
end
local content = read_all(this_file)
local crc32_result = crc32.hash(content)
local crc32_expected = ''
local crc32_expected = 000000000
print('My expected crc32 checksum is ' .. crc32_expected)
print('My own crc32 checksum is ' .. crc32_result)