jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
async function generateRandomHexKey(length) {
const array = new Uint8Array(length);
window.crypto.getRandomValues(array);
return Array.from(array).map(b => b.toString(16).padStart(2, '0')).join('').substring(0, length);
}
async function startBruteForce(length) {
const key = await generateRandomHexKey(length); // Adjust key length as needed
console.log('Generated key: ' + key);
const startTime = performance.now();
let attempt = 0;
let hexAttempt = '';
while (hexAttempt !== key) {
hexAttempt = attempt.toString(16).padStart(key.length, '0');
attempt++;
}
const timeTaken = (performance.now() - startTime) / 1000; // Convert to seconds
console.log(`Brute force of key ${key} took ${timeTaken.toFixed(2)} seconds.`);
}
Ready to run.
Test | Ops/sec | |
---|---|---|
brute force test 4 |
| ready |
brute force test 5 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.