import { useState, useEffect } from "react"; // Stable random seeds for noise signatures const NOISE_SEEDS = Array.from({ length: 30 }, () => Math.random()); const PRNUSensorMeter = ({ score }: { score: number }) => { const [time, setTime] = useState(0); useEffect(() => { let frame: number; const update = () => { setTime(prev => prev + 1); frame = requestAnimationFrame(update); }; frame = requestAnimationFrame(update); return () => cancelAnimationFrame(frame); }, []); // score is 0-100. Lower score = Likely Real (Good Spectral Noise PRNU) // Higher score = AI (Smooth High-Frequency FFT spectrum / no sensor noise) const isReal = score < 50; const color = isReal ? "var(--color-text-success)" : "var(--color-text-danger)"; return (
PRNU Hardware Sensor Noise
{[...Array(30)].map((_, i) => { // Real Physics: A rich broadband noise spectrum jumping dynamically (Stochastic PRNU noise) // AI: Exceptionally clean spectrum with zero noise, or strong repeating anomalies const t = time / Math.PI; const h = isReal ? 15 + Math.random() * 20 + Math.sin(t * NOISE_SEEDS[i]) * 10 : 3 + Math.sin(i * 0.5 + t/10) * 3; // Smooth synthesis, no sensor noise return (
); })}
{isReal ? "Genuine Silicon Noise Profile" : "Zero High-Frequency Sensor Noise"}
{isReal ? "High-Pass Filter FFT (Verified)" : "Mathematically Pristine Generation"}
); }; export default PRNUSensorMeter;