MEGAINFRA-WEBAPP/scripts/generate-mcp-key.mjs

4 lines
173 B
JavaScript
Raw Normal View History

import {randomBytes,hash} from 'node:crypto';
const token=randomBytes(32).toString('base64url');
console.log(JSON.stringify({token,tokenHash:hash('sha256',token)},null,2));