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

3 lines
173 B
JavaScript

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