mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-22 04:25:08 +01:00
3e897727ca
* 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
8 lines
No EOL
199 B
TypeScript
8 lines
No EOL
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");
|
|
}; |