2 changed files with 26 additions and 0 deletions
@ -0,0 +1,16 @@ |
|||||
|
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; |
Loading…
Reference in new issue