bench: reverse hex string hash

This commit is contained in:
Matthew Zipkin 2019-04-04 23:59:30 -07:00
parent 1b868b6a9d
commit fc7fd3cb4b
No known key found for this signature in database
GPG Key ID: E7E2984B6289C93A

17
bench/hexstring.js Normal file
View File

@ -0,0 +1,17 @@
'use strict';
const random = require('bcrypto/lib/random');
const util = require('../lib/utils/util');
const bench = require('./bench');
const hashes = [];
for (let i = 0; i < 100000; i++)
hashes.push(random.randomBytes(32));
{
const end = bench('hexstring');
for (let i = 0; i < hashes.length; i++)
util.fromRev(util.revHex(hashes[i]));
end(100000);
}