* 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:
parent
d0570d7fe3
commit
3e897727ca
3 changed files with 106 additions and 34 deletions
8
src/client/app/common/scripts/get-md5.ts
Normal file
8
src/client/app/common/scripts/get-md5.ts
Normal 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");
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue