TenantAtlas/apps/platform/.pnpm-store/v10/files/82/00ab9b149f93bf339ec9995d9594d713bb372badf5752e6952e2640134daeb05abcc40b39eea5da2eccecf9040aaac7ffc41d3cedca9cfa3741b7d85d47825
Ahmed Darrazi 9f74f7a658
Some checks failed
PR Fast Feedback / fast-feedback (pull_request) Failing after 51s
feat: compress governance operator outcomes
2026-04-19 14:15:11 +02:00

38 lines
837 B
Plaintext

import crypto from 'crypto';
import URLSearchParams from './classes/URLSearchParams.js';
import FormData from './classes/FormData.js';
const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
const DIGIT = '0123456789';
const ALPHABET = {
DIGIT,
ALPHA,
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT,
};
const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
let str = '';
const { length } = alphabet;
const randomValues = new Uint32Array(size);
crypto.randomFillSync(randomValues);
for (let i = 0; i < size; i++) {
str += alphabet[randomValues[i] % length];
}
return str;
};
export default {
isNode: true,
classes: {
URLSearchParams,
FormData,
Blob: (typeof Blob !== 'undefined' && Blob) || null,
},
ALPHABET,
generateString,
protocols: ['http', 'https', 'file', 'data'],
};