bw-hspc-contest-env/extension/bwcontest/src/getNonce.ts
2023-05-06 00:01:27 -04:00

9 lines
252 B
TypeScript

export function getNonce() {
let text = '';
const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
for (let i = 0; i < 32; i++) {
text += possible.charAt(Math.floor(Math.random() * possible.length));
}
return text;
}