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,7 +8,11 @@
-- Data card support added by https://github.com/SuPeRMiNoR2 -- Data card support added by https://github.com/SuPeRMiNoR2
_G.sha = {} _G.sha = {}
if component then if component then
if component.data then if component.data and not component.ocemu then
shamode = "hardware"
end
end
if shamode == "hardware" then
datac = component.data datac = component.data
function sha.sha256(data) function sha.sha256(data)
local d=component.data.sha256(data) local d=component.data.sha256(data)
@ -16,7 +20,6 @@ if component then
return string.format("%02x", string.byte(c)) return string.format("%02x", string.byte(c))
end)) end))
end end
end
else else
local MOD = 2^32 local MOD = 2^32
local MODM = MOD-1 local MODM = MOD-1