Skip to content

Instantly share code, notes, and snippets.

@JeffML
Created January 14, 2017 20:25
Show Gist options
  • Save JeffML/d06d433e59379dae28d3f5462ce7a88c to your computer and use it in GitHub Desktop.
Save JeffML/d06d433e59379dae28d3f5462ce7a88c to your computer and use it in GitHub Desktop.
const crypto = require('crypto');
const _ = require('lodash')
function hash(choice) {
var str = _.chain(choice)
.flatten()
.sortBy()
.join('|')
.value();
return crypto.createHmac('sha256', 'old ice cream')
.update(str)
.digest('hex');
}
module.exports = hash;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment