super-fast-md5
super-fast-md5 copied to clipboard
Bench
Node version: v17.4.0
normail md5 355490 ops π π π π π π π π π
super-fast-md5 725495 ops π π π π π π π π π π π π π π π π π π π π
Codes
const crypto = require('crypto');
const FastMd5 = require('super-fast-md5').md5;
const Bench = require('@mohism/bench').default;
const bench = new Bench();
const md5 = text => {
return crypto
.createHash('md5')
.update(text)
.digest('hex');
};
const fastMd5 = text => {
return FastMd5(text);
}
bench.add('normail md5',()=>{
md5('123456');
});
bench.add('super-fast-md5',()=>{
fastMd5('123456');
});
bench.run();
This is a wasm version of the implementation, not as fast as the native nodejs implementation, but much faster than the js implementation, the main use will be in the browser.
This is a wasm version of the implementation, not as fast as the native
nodejsimplementation, but much faster than thejsimplementation, the main use will be in thebrowser.
Got it,
ε°΄ε°¬οΌθΏζ―ζδΈζε₯½δΊ