You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
417 B
16 lines
417 B
const {promisify} = require('util');
|
|
const readFile = promisify(require('fs').readFile);
|
|
const crypto = require('crypto');
|
|
|
|
const constants = require('utils/const.js');
|
|
|
|
const deriveEntropy = async indentifier => {
|
|
const umbrel_seed = await readFile(constants.UMBREL_SEED_FILE);
|
|
|
|
return crypto
|
|
.createHmac('sha256', umbrel_seed)
|
|
.update(indentifier)
|
|
.digest('hex');
|
|
};
|
|
|
|
module.exports = deriveEntropy;
|