ForestAdmin/lumber

View on GitHub
services/key-generator.js

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
const P = require('bluebird');
const crypto = require('crypto');

const randomBytes = P.promisify(crypto.randomBytes);

function KeyGenerator() {
  this.generate = () => randomBytes(48).then((buffer) => buffer.toString('hex'));
}

module.exports = KeyGenerator;