made sha256.lua behave on plain lua

This commit is contained in:
Izaya 2017-09-07 12:58:42 +10:00
parent 0d6c5f6d56
commit ecba456ef6

View File

@ -6,8 +6,9 @@
-- Found Here: https://bitbucket.org/Boolsheet/bslf/src/1ee664885805/bit.lua -- Found Here: https://bitbucket.org/Boolsheet/bslf/src/1ee664885805/bit.lua
-- --
-- Data card support added by https://github.com/SuPeRMiNoR2 -- Data card support added by https://github.com/SuPeRMiNoR2
sha = {} _G.sha = {}
if component.data then if component then
if component.data 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)
@ -15,6 +16,7 @@ if component.data 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