fixed sha256.lua, included it in the kernel.

This commit is contained in:
Izaya 2017-08-02 18:00:03 +10:00
parent 0eeb2a3a58
commit bd41474e31
2 changed files with 11 additions and 1 deletions

View File

@ -10,6 +10,7 @@ modules/drivers/kbd.lua
modules/drivers/net.lua
modules/lib/readline.lua
modules/lib/shutil.lua
modules/lib/sha256.lua
modules/applications/luash.lua
modules/applications/genkernel.lua
modules/applications/skex2.lua

View File

@ -7,10 +7,19 @@
--
-- Data card support added by https://github.com/SuPeRMiNoR2
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 MODM = MOD-1
local function memoize(f)
local mt = {}
local t = setmetatable({}, mt)