Generate a random string using Node crypto module

JavaScript version
const randomStr = () => require('crypto').randomBytes(32).toString('hex');
TypeScript version
const randomStr = (): string => require('crypto').randomBytes(32).toString('hex');