fixed sha256.lua, included it in the kernel.
This commit is contained in:
parent
0eeb2a3a58
commit
bd41474e31
@ -10,6 +10,7 @@ modules/drivers/kbd.lua
|
|||||||
modules/drivers/net.lua
|
modules/drivers/net.lua
|
||||||
modules/lib/readline.lua
|
modules/lib/readline.lua
|
||||||
modules/lib/shutil.lua
|
modules/lib/shutil.lua
|
||||||
|
modules/lib/sha256.lua
|
||||||
modules/applications/luash.lua
|
modules/applications/luash.lua
|
||||||
modules/applications/genkernel.lua
|
modules/applications/genkernel.lua
|
||||||
modules/applications/skex2.lua
|
modules/applications/skex2.lua
|
||||||
|
@ -7,10 +7,19 @@
|
|||||||
--
|
--
|
||||||
-- Data card support added by https://github.com/SuPeRMiNoR2
|
-- Data card support added by https://github.com/SuPeRMiNoR2
|
||||||
sha = {}
|
sha = {}
|
||||||
do
|
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
|
||||||
|
else
|
||||||
local MOD = 2^32
|
local MOD = 2^32
|
||||||
local MODM = MOD-1
|
local MODM = MOD-1
|
||||||
|
|
||||||
|
|
||||||
local function memoize(f)
|
local function memoize(f)
|
||||||
local mt = {}
|
local mt = {}
|
||||||
local t = setmetatable({}, mt)
|
local t = setmetatable({}, mt)
|
||||||
|
Loading…
Reference in New Issue
Block a user