import { useBackend } from '../backend'; import { NtosWindow } from '../layouts'; import { IdentificationComputerRegions } from './IdentificationComputer'; import { NoticeBox, Box, Section, Button } from '../components'; import { BooleanLike } from 'common/react'; type Data = { message: string; running: BooleanLike; rate: number; factor: number; regions: []; }; export const NtosAccessDecrypter = (props, context) => { const { act, data } = useBackend(context); const { message, running, rate, factor, regions } = data; const generate10String = (length: number) => { let outString = ''; while (outString.length < length) { if (Math.random() > factor) { outString += '0'; } else { outString += '1'; } } return outString; }; const lineLength = 45; return ( {(message && {message}) || (running && (
Attempting to decrypt network access codes. Please wait. Rate: {rate} PHash/s {/* I don't care anymore */} {generate10String(lineLength)} {generate10String(lineLength)} {generate10String(lineLength)} {generate10String(lineLength)} {generate10String(lineLength)}
)) || (
{(regions.length && ) || ( Please insert ID card. )}
)}
); };