hash.js 185 Bytes Raw Blame History Permalink 1 2 3 4 5 6 const crypto = require('crypto'); module.exports = function(id, ip) { let hash = crypto.createHmac('sha256', `${id}${ip}sytgsalt`); return hash.digest('base64').slice(0, 8); };