Files
cloudron-box/src/hat.js

10 lines
168 B
JavaScript
Raw Normal View History

'use strict';
exports = module.exports = hat;
const crypto = require('node:crypto');
2022-02-01 17:31:26 -08:00
function hat(bits) {
return crypto.randomBytes(bits / 8).toString('hex');
}