|
|
@ -12,7 +12,7 @@ var reverseHex = function (hex) { |
|
|
|
}; |
|
|
|
|
|
|
|
var numWorkers = require('os').cpus().length; |
|
|
|
numWorkers = 20; |
|
|
|
numWorkers = 1; /* increase for multi-thread testing of data collision */ |
|
|
|
|
|
|
|
if (cluster.isMaster) { |
|
|
|
|
|
|
@ -28,13 +28,15 @@ if (cluster.isMaster) { |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
var output = vh.hash(Buffer.from('Test1234','utf8')); |
|
|
|
console.log(process.pid,'VerusHash1 Output', reverseHex(output.toString('hex')), '\n'); |
|
|
|
output = vh.init().update(Buffer.from('Test','utf8')).update(Buffer.from('123','utf8')).update(Buffer.from('4','utf8')).digest(); |
|
|
|
console.log(process.pid,'VerusHash1 Output', reverseHex(output.toString('hex')), '\n'); |
|
|
|
var output = vh.hash(Buffer.from('Test1234Test1234Test1234Test1234Test1234Test1234Test1234Test1234Test1234Test1234Test1234Test1234','utf8')); |
|
|
|
console.log(process.pid,'VerusHash1 Output', reverseHex(output.toString('hex')), '\n'); |
|
|
|
|
|
|
|
output = vh.hash2(Buffer.from('Test1234','utf8')); |
|
|
|
console.log(process.pid,'VerusHash2 Output', reverseHex(output.toString('hex')), '\n'); |
|
|
|
output = vh.init().update2(Buffer.from('Test','utf8')).update2(Buffer.from('123','utf8')).update2(Buffer.from('4','utf8')).digest2(); |
|
|
|
console.log(process.pid,'VerusHash2 Output', reverseHex(output.toString('hex')), '\n'); |
|
|
|
output = vh.hash2(Buffer.from('Test1234Test1234Test1234Test1234Test1234Test1234Test1234Test1234Test1234Test1234Test1234Test1234','utf8')); |
|
|
|
console.log(process.pid,'VerusHash2 Output', reverseHex(output.toString('hex')), '\n'); |
|
|
|
|
|
|
|
output = vh.hash2b(Buffer.from('Test1234Test1234Test1234Test1234Test1234Test1234Test1234Test1234Test1234Test1234Test1234Test1234','utf8')); |
|
|
|
console.log(process.pid,'VerusHash2b Output', reverseHex(output.toString('hex')), '\n'); |
|
|
|
|
|
|
|
output = vh.hash2b1(Buffer.from('Test1234Test1234Test1234Test1234Test1234Test1234Test1234Test1234Test1234Test1234Test1234Test1234','utf8')); |
|
|
|
console.log(process.pid,'VerusHash2b1 Output', reverseHex(output.toString('hex')), '\n'); |
|
|
|
} |
|
|
|