Created
January 14, 2017 20:25
-
-
Save JeffML/d06d433e59379dae28d3f5462ce7a88c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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