rudeshark.net/src/client/app/common/scripts/get-md5.ts
sei0o inoue 3e897727ca Fix #2773 (#2841)
* 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
2018-10-07 16:51:46 +09:00

8 lines
199 B
TypeScript

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