aboutsummaryrefslogtreecommitdiff
path: root/src/api/utils
diff options
context:
space:
mode:
authorPitu <[email protected]>2019-10-01 14:11:16 -0300
committerPitu <[email protected]>2019-10-01 14:11:16 -0300
commit579e1e754ab59a69925b5114641174aa70d18555 (patch)
tree59a49fefb8c4753dfef4df455b8b8c5cd19519bc /src/api/utils
parentchore: Remove unnecesary stuff (diff)
downloadhost.fuwn.me-579e1e754ab59a69925b5114641174aa70d18555.tar.xz
host.fuwn.me-579e1e754ab59a69925b5114641174aa70d18555.zip
feature: uploader with chunks support
Diffstat (limited to 'src/api/utils')
-rw-r--r--src/api/utils/Util.js5
1 files changed, 5 insertions, 0 deletions
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
}