summaryrefslogtreecommitdiff
path: root/src/client/app/common/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/app/common/scripts')
-rw-r--r--src/client/app/common/scripts/get-md5.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/client/app/common/scripts/get-md5.ts b/src/client/app/common/scripts/get-md5.ts
new file mode 100644
index 0000000000..24ac04c1ad
--- /dev/null
+++ b/src/client/app/common/scripts/get-md5.ts
@@ -0,0 +1,8 @@
+const crypto = require('crypto');
+
+export default (data: ArrayBuffer) => {
+ const buf = new Buffer(data);
+ const hash = crypto.createHash("md5");
+ hash.update(buf);
+ return hash.digest("hex");
+}; \ No newline at end of file