3d-interface/lib/vcode.js

15 lines
279 B
JavaScript
Raw Normal View History

2015-09-29 15:46:31 +02:00
var hash = require('sha256');
var secretKey = require('../private.js').microSecretKey;
module.exports = function(workerId, campaignId) {
if (campaignId === undefined) {
return 'mw-dummyvcode';
}
2015-09-29 15:46:31 +02:00
return 'mw-' + hash(campaignId + workerId + secretKey);
}