There is no perfect hash encryption method. It all depends on your system configurations and settings. For the best result that suits your need, you can run a benchmark test against all hash methods and can evaluate yourself.
The code to run the benchmark is as follows
const Benchmark = require('benchmark');
const suite = new Benchmark.Suite;
const hash = require('crypto').createHash;
const data = 'Delightful remarkably mr on announcing themselves entreaties favourable. About to in so terms voice at. Equal an would is found seems of. The particular friendship one sufficient terminated frequently themselves. It more shed went up is roof if loud case. Delay music in lived noise an. Beyond genius really enough passed is up.';
const scenarios = [
{ alg: 'md5', digest: 'hex' },
{ alg: 'md5', digest: 'base64' },
{ alg: 'sha1', digest: 'hex' },
{ alg: 'sha1', digest: 'base64' },
{ alg: 'sha256', digest: 'hex' },
{ alg: 'sha256', digest: 'base64' }
];
for (const { alg, digest } of scenarios) {
suite.add(`${alg}-${digest}`, () =>
hash(alg).update(data).digest(digest)
);
}
suite.on('cycle', function (event) {
console.log(String(event.target));
})
.on('complete', function () {
console.log('Fastest is ' + this.filter('fastest').map('name'));
})
.run();
For more related details you can follow the following blog article
https://medium.com/@chris_72272/what-is-the-fastest-node-js-hashing-algorithm-c15c1a0e164e