Files
cloudron-box/src/hat.js
T

8 lines
136 B
JavaScript
Raw Normal View History

import crypto from 'node:crypto';
2018-06-11 12:38:15 -07:00
export default hat;
2018-06-11 12:38:15 -07:00
2022-02-01 17:31:26 -08:00
function hat(bits) {
2018-06-11 12:38:15 -07:00
return crypto.randomBytes(bits / 8).toString('hex');
}