diff --git a/build.cfg b/build.cfg index e6e1d4c..92a7633 100755 --- a/build.cfg +++ b/build.cfg @@ -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 diff --git a/modules/lib/sha256.lua b/modules/lib/sha256.lua index ccad741..a794a28 100644 --- a/modules/lib/sha256.lua +++ b/modules/lib/sha256.lua @@ -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)