8 lines
136 B
JavaScript
8 lines
136 B
JavaScript
import crypto from 'node:crypto';
|
|
|
|
function hat(bits) {
|
|
return crypto.randomBytes(bits / 8).toString('hex');
|
|
}
|
|
|
|
export default hat;
|