Merge pull request #1856 from houqp/fixmd5

fix: use ffi/md5 in plugins
pull/1854/head
Huang Xin 8 years ago
commit 2d7d7f8b8b

@ -1,7 +1,7 @@
local DocumentRegistry = require("document/documentregistry")
local DocSettings = require("docsettings")
local DEBUG = require("dbg")
local md5 = require("MD5")
local md5 = require("ffi/MD5")
-- lfs
local MyClipping = {
@ -220,7 +220,7 @@ function MyClipping:getImage(image)
--doc:clipPagePNGFile(image.pos0, image.pos1,
--image.pboxes, image.drawer, "/tmp/"..md5(png)..".png")
doc:close()
if png then return { png = png, hash = md5(png) } end
if png then return { png = png, hash = md5.sum(png) } end
end
end

@ -12,7 +12,7 @@ local Math = require("optmath")
local DEBUG = require("dbg")
local T = require("ffi/util").template
local _ = require("gettext")
local md5 = require("MD5")
local md5 = require("ffi/MD5")
local l10n = {
_("Unknown server error."),
@ -165,7 +165,7 @@ function KOSync:doRegister(username, password)
custom_url = self.kosync_custom_server,
service_spec = self.path .. "/api.json"
}
local userkey = md5:sum(password)
local userkey = md5.sum(password)
local ok, status, body = pcall(client.register, client, username, userkey)
if not ok and status then
UIManager:show(InfoMessage:new{
@ -195,7 +195,7 @@ function KOSync:doLogin(username, password)
custom_url = self.kosync_custom_server,
service_spec = self.path .. "/api.json"
}
local userkey = md5:sum(password)
local userkey = md5.sum(password)
local ok, status, body = pcall(client.authorize, client, username, userkey)
if not ok and status then
UIManager:show(InfoMessage:new{

Loading…
Cancel
Save