fix: use ffi/md5 in plugins

This commit is contained in:
Qingping Hou
2016-02-27 12:58:11 -08:00
parent 7b11491dcd
commit ac9888f106
2 changed files with 5 additions and 5 deletions

View File

@@ -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

View File

@@ -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{