add Document:fastDigest method to calculate document hash without performance overhead

This commit is contained in:
chrox
2015-02-19 22:15:31 +08:00
parent 07ff30f89c
commit 5c9a9198fb
2 changed files with 36 additions and 0 deletions

View File

@@ -28,6 +28,9 @@ describe("PDF document module", function()
local clip1 = doc:clipPagePNGString(pos0, pos1, pboxes, "lighten")
assert.truthy(clip1)
end)
it("should calculate fast digest", function()
assert.is_equal(doc:fastDigest(), "41cce710f34e5ec21315e19c99821415")
end)
it("should close document", function()
doc:close()
end)
@@ -45,6 +48,9 @@ describe("EPUB document module", function()
assert.are.same(image:getWidth(), 442)
assert.are.same(image:getHeight(), 616)
end)
it("should calculate fast digest", function()
assert.is_equal(doc:fastDigest(), "59d481d168cca6267322f150c5f6a2a3")
end)
it("should close document", function()
doc:close()
end)