* Added an API endpoint to check the existence of the file

* fix #2773: Now we can prevent users from posting the same images

* bug fix
This commit is contained in:
sei0o inoue
2018-10-07 16:51:46 +09:00
committed by syuilo
parent d0570d7fe3
commit 3e897727ca
3 changed files with 106 additions and 34 deletions

View File

@ -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");
};