bench: reverse hex string hash
This commit is contained in:
parent
1b868b6a9d
commit
fc7fd3cb4b
17
bench/hexstring.js
Normal file
17
bench/hexstring.js
Normal 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);
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user