From 6e854e23545eb27c8d9244194aaca390e99e142f Mon Sep 17 00:00:00 2001 From: Jordan Earls Date: Fri, 25 Apr 2014 00:36:19 -0400 Subject: [PATCH 1/3] Allow specifying raw N-value and R-value to scrypt --- lib/algoProperties.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/algoProperties.js b/lib/algoProperties.js index 254cea3..2278ef9 100644 --- a/lib/algoProperties.js +++ b/lib/algoProperties.js @@ -14,13 +14,15 @@ var algos = module.exports = global.algos = { } } }, - scrypt: { + 'scrypt': { //Uncomment diff if you want to use hardcoded truncated diff //diff: '0000ffff00000000000000000000000000000000000000000000000000000000', multiplier: Math.pow(2, 16), - hash: function(){ - return function(){ - return multiHashing.scrypt.apply(this, arguments); + hash: function(coinConfig){ + var nValue = coinConfig.nValue || 1024; + var rValue = coinConfig.rValue || 1; + return function(data){ + return multiHashing.scrypt(data,nValue,rValue); } } }, @@ -158,4 +160,4 @@ for (var algo in algos){ else{ algos[algo].maxDiff = diff1; }*/ -} \ No newline at end of file +} From 4191f5b794e915ce368209069944566884bace39 Mon Sep 17 00:00:00 2001 From: Jordan Earls Date: Fri, 25 Apr 2014 00:59:59 -0400 Subject: [PATCH 2/3] Add nValue and rValue to readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 4ea6679..300117d 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,8 @@ var myCoin = { "name": "Dogecoin", "symbol": "DOGE", "algorithm": "scrypt", + "nValue": 1024, //optional. Defaults to 1 + "rValue": 1, //optional. Defaults to 1 "txMessages": false, //or true (not required, defaults to false) }; ``` From 23ab72f514e339ab80a872e3d9cfbf671b7ff587 Mon Sep 17 00:00:00 2001 From: Jordan Earls Date: Fri, 25 Apr 2014 01:12:01 -0400 Subject: [PATCH 3/3] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 300117d..fab0052 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ var myCoin = { "name": "Dogecoin", "symbol": "DOGE", "algorithm": "scrypt", - "nValue": 1024, //optional. Defaults to 1 + "nValue": 1024, //optional. Defaults to 1024 "rValue": 1, //optional. Defaults to 1 "txMessages": false, //or true (not required, defaults to false) };