ripunzel/src/curate/hashPost.js

13 lines
252 B
JavaScript

'use strict';
const crypto = require('crypto');
function hashPost(post) {
return crypto
.createHash('md5')
.update(post.id + post.subreddit_id + post.created_utc + post.title)
.digest('hex');
}
module.exports = hashPost;