Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
var crypto = require('crypto');
var crc32 = require('crc').crc32;
var x = 1;
while(1){
var string = '';
for (var j=0; j<x; j++) {
string += String(Math.random());
}
var iter = 1000000/Math.sqrt(x);
var start = Date.now();
for (var i=0; i<iter; i++) {
crypto.createHash('md5').update(string).digest('hex');
}
var fin1 = Date.now();
for (var i=0; i<iter; i++) {
crc32(string);
}
console.log(string.length, (fin1-start)/iter*1000000, (Date.now()-fin1)/iter*1000000);
x*=1.5;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.