From b5014729e777211aa79659ea50e35daf4da12d93 Mon Sep 17 00:00:00 2001 From: "kepler155c@gmail.com" Date: Fri, 28 Jun 2019 06:34:14 -0400 Subject: [PATCH] sha conversion --- common/Appstore.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/common/Appstore.lua b/common/Appstore.lua index 69af19f..4b5ce3d 100644 --- a/common/Appstore.lua +++ b/common/Appstore.lua @@ -1,5 +1,5 @@ local Ansi = require('ansi') -local SHA1 = require('sha1') +local SHA = require('crypto.sha2') local UI = require('ui') local Util = require('util') @@ -14,15 +14,13 @@ local REGISTRY_DIR = 'usr/.registry' -- FIX SOMEDAY local function registerApp(app, key) - - app.key = SHA1.sha1(key) + app.key = SHA.compute(key) Util.writeTable(fs.combine(REGISTRY_DIR, app.key), app) os.queueEvent('os_register_app') end local function unregisterApp(key) - - local filename = fs.combine(REGISTRY_DIR, SHA1.sha1(key)) + local filename = fs.combine(REGISTRY_DIR, SHA.compute(key)) if fs.exists(filename) then fs.delete(filename) os.queueEvent('os_register_app')