From 579e1e754ab59a69925b5114641174aa70d18555 Mon Sep 17 00:00:00 2001 From: Pitu Date: Tue, 1 Oct 2019 14:11:16 -0300 Subject: feature: uploader with chunks support --- src/api/utils/Util.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/api/utils') diff --git a/src/api/utils/Util.js b/src/api/utils/Util.js index 1776f3e..d7c9623 100644 --- a/src/api/utils/Util.js +++ b/src/api/utils/Util.js @@ -155,6 +155,11 @@ class Util { return hash.digest('hex'); } + static generateFileHash(data) { + const hash = crypto.createHash('sha1').update(data).digest('hex'); + return hash; + } + static getFilenameFromPath(fullPath) { return fullPath.replace(/^.*[\\\/]/, ''); // eslint-disable-line no-useless-escape } -- cgit v1.2.3