made sha256.lua work with ocemu

This commit is contained in:
Izaya 2017-09-07 13:11:32 +10:00
parent ecba456ef6
commit af2ce42583

View File

@ -8,14 +8,17 @@
-- Data card support added by https://github.com/SuPeRMiNoR2
_G.sha = {}
if component then
if component.data then
datac = component.data
function sha.sha256(data)
local d=component.data.sha256(data)
return (d:gsub('.',function(c)
return string.format("%02x", string.byte(c))
end))
end
if component.data and not component.ocemu then
shamode = "hardware"
end
end
if shamode == "hardware" then
datac = component.data
function sha.sha256(data)
local d=component.data.sha256(data)
return (d:gsub('.',function(c)
return string.format("%02x", string.byte(c))
end))
end
else
local MOD = 2^32