Skip to content

Commit

Permalink
Fixed some test stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
MoneroOcean committed Jun 14, 2018
1 parent 40d0f51 commit 7f48256
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Cryptonight hashing functions for node.js.

Algorithms
----------
* cryptonight (v0, v1, xtl)
* cryptonight (v0, v1, xtl, msr)
* cryptonight-light (v0, v1, ipbc)
* cryptonight-heavy
* cryptonight-heavy (v0, xhv)

Usage
-----
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cryptonight-hashing",
"version": "2.0.0",
"version": "2.1.0",
"main": "cryptonight-hashing",
"author": {
"name": "Multiple",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sync-msr.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let lr = lineReader.createInterface({
});
lr.on('line', function (line) {
let line_data = line.split(/ (.+)/);
let result = multiHashing.cryptonight(Buffer.from(line_data[1], 'hex'), 3).toString('hex');
let result = multiHashing.cryptonight(Buffer.from(line_data[1], 'hex'), 4).toString('hex');
if (line_data[0] !== result){
console.error(line_data[1] + ": " + result);
testsFailed += 1;
Expand Down
26 changes: 26 additions & 0 deletions tests/test_sync_heavy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"use strict";
let multiHashing = require('../build/Release/cryptonight-hashing');
let fs = require('fs');
let lineReader = require('readline');

let testsFailed = 0, testsPassed = 0;
let lr = lineReader.createInterface({
input: fs.createReadStream('cryptonight_heavy.txt')
});
lr.on('line', function (line) {
let line_data = line.split(/ (.+)/);
let result = multiHashing.cryptonight_heavy(Buffer.from(line_data[1], 'hex')).toString('hex');
if (line_data[0] !== result){
console.error(line_data[1] + ": " + result);
testsFailed += 1;
} else {
testsPassed += 1;
}
});
lr.on('close', function(){
if (testsFailed > 0){
console.log(testsFailed + '/' + (testsPassed + testsFailed) + ' tests failed on: cryptonight_heavy');
} else {
console.log(testsPassed + ' tests passed on: cryptonight_heavy');
}
});

0 comments on commit 7f48256

Please sign in to comment.