Go to file
clintar fbceb71204 Nan 2.0 changed api. Set required Nan version to 1 2015-08-19 00:10:47 -06:00
crypto Boolberry support 2014-06-03 21:20:43 +01:00
scryptjane more 2014-03-30 04:12:48 -04:00
sha3 Added initial x15 support 2014-06-27 11:22:42 -06:00
.gitignore Initial commit of changes to get this to build using nan. Not sure what I'm doing, though. Not tested 2015-04-10 14:17:52 -06:00
.travis.yml Added nMin and nMax config for scrypt-jane 2014-03-31 16:06:50 -06:00
README.md Added nist5 hashing 2014-06-14 13:11:19 -06:00
bcrypt.c Init 2014-03-30 04:04:48 -04:00
bcrypt.h Init 2014-03-30 04:04:48 -04:00
binding.gyp Initial commit of changes to get this to build using nan. Not sure what I'm doing, though. Not tested 2015-04-10 14:17:52 -06:00
blake.c Allow varying input length with scrypt, scryptn and scryptjane 2014-04-19 19:27:09 +01:00
blake.h Allow varying input length with scrypt, scryptn and scryptjane 2014-04-19 19:27:09 +01:00
boolberry.cc Boolberry support 2014-06-03 21:20:43 +01:00
boolberry.h Boolberry support 2014-06-03 21:20:43 +01:00
cryptonight.c Boolberry support 2014-06-03 21:20:43 +01:00
cryptonight.h cn_fast_hash support 2014-05-14 16:56:17 +01:00
fresh.c Initial FRESH support 2014-07-07 21:55:27 +01:00
fresh.h Initial FRESH support 2014-07-07 21:55:27 +01:00
fugue.c Initial fugue support 2014-04-19 20:28:17 +01:00
fugue.h Initial fugue support 2014-04-19 20:28:17 +01:00
groestl.c slight naming convention change 2014-04-21 13:43:41 -06:00
groestl.h slight naming convention change 2014-04-21 13:43:41 -06:00
hefty1.c Fix compiler warnings 2014-05-12 21:12:20 +01:00
hefty1.h Initial hefty1 support 2014-04-19 21:46:10 +01:00
index.js Init 2014-03-30 04:04:48 -04:00
keccak.c Initial shavite3 support 2014-04-19 22:33:45 +01:00
keccak.h Initial shavite3 support 2014-04-19 22:33:45 +01:00
multihashing.cc Initial commit of changes to get this to build using nan. Not sure what I'm doing, though. Not tested 2015-04-10 14:17:52 -06:00
nist5.c Added nist5 hashing 2014-06-14 13:11:19 -06:00
nist5.h Added nist5 hashing 2014-06-14 13:11:19 -06:00
package.json Nan 2.0 changed api. Set required Nan version to 1 2015-08-19 00:10:47 -06:00
quark.c Fix compiler warnings & scrypt hashing with variable length 2014-04-19 20:15:34 +01:00
quark.h Allow varying input length with scrypt, scryptn and scryptjane 2014-04-19 19:27:09 +01:00
qubit.c Fix compiler warnings 2014-05-12 21:12:20 +01:00
qubit.h Initial support for qubit 2014-04-19 20:49:49 +01:00
scryptjane.c Fix deprecated import 2014-04-28 16:36:04 +01:00
scryptjane.h Allow varying input length with scrypt, scryptn and scryptjane 2014-04-19 19:27:09 +01:00
scryptn.c Change scrypt so that N and R values can be specified 2014-04-25 00:57:27 -04:00
scryptn.h Change scrypt so that N and R values can be specified 2014-04-25 00:57:27 -04:00
sha1.c rename sha1coin to sha1 2014-06-13 19:08:50 +09:00
sha1.h rename SHA1COIN_H to SHA1_H 2014-06-15 08:29:39 +09:00
sha256.h Fix compiler warnings & scrypt hashing with variable length 2014-04-19 20:15:34 +01:00
shavite3.c Fix compiler warnings 2014-05-12 21:12:20 +01:00
shavite3.h Initial shavite3 support 2014-04-19 22:33:45 +01:00
skein.c Allocate buffers on stack rather than heap 2014-04-21 14:31:03 +01:00
skein.h Allow varying input length with scrypt, scryptn and scryptjane 2014-04-19 19:27:09 +01:00
stdint.h Init 2014-03-30 04:04:48 -04:00
x11.c Allow varying input length with scrypt, scryptn and scryptjane 2014-04-19 19:27:09 +01:00
x11.h Initial shavite3 support 2014-04-19 22:33:45 +01:00
x13.c Initial x13 support 2014-05-29 02:22:57 +01:00
x13.h Initial x13 support 2014-05-29 02:22:57 +01:00
x15.c Added initial x15 support 2014-06-27 11:22:42 -06:00
x15.h Added initial x15 support 2014-06-27 11:22:42 -06:00

README.md

node-multi-hashing

Build Status

NPM

Cryptocurrency hashing functions for node.js.

Algorithms

  • quark
  • x11
  • x13
  • nist5
  • scrypt
  • scryptn
  • scryptjane
  • keccak
  • bcrypt
  • skein
  • groestl
  • blake
  • fugue
  • qubit
  • hefty1
  • shavite3
  • cryptonight
  • boolberry

Usage

Install

npm install multi-hashing

So far this native Node.js addon can do the following hashing algos

var multiHashing = require('multi-hashing');

var algorithms = ['quark', 'x11', 'scrypt', 'scryptn', 'scryptjane', 'keccak', 'bcrypt', 'skein', 'blake'];

var data = new Buffer("7000000001e980924e4e1109230383e66d62945ff8e749903bea4336755c00000000000051928aff1b4d72416173a8c3948159a09a73ac3bb556aa6bfbcad1a85da7f4c1d13350531e24031b939b9e2b", "hex");

var hashedData = algorithms.map(function(algo){
    if (algo === 'scryptjane'){
        //scryptjane needs block.nTime and nChainStartTime (found in coin source)
        var yaCoinChainStartTime = 1367991200;
        var nTime = Math.round(Date.now() / 1000);
        return multiHashing[algo](data, nTime, yaCoinChainStartTime);
    }
    else{
        return multiHashing[algo](data);
    }
});


console.log(hashedData);
//<SlowBuffer 0b de 16 ef 2d 92 e4 35 65 c6 6c d8 92 d9 66 b4 3d 65 ..... >


Credits

  • NSA and NIST for creation or sponsoring creation of SHA2 and SHA3 algos
  • Keccak - Guido Bertoni, Joan Daemen, Michaël Peeters, and Gilles Van Assche
  • Skein - Bruce Schneier, Stefan Lucks, Niels Ferguson, Doug Whiting, Mihir Bellare, Tadayoshi Kohno, Jon Callas and Jesse Walker.
  • BLAKE - Jean-Philippe Aumasson, Luca Henzen, Willi Meier, and Raphael C.-W. Phan
  • Grøstl - Praveen Gauravaram, Lars Knudsen, Krystian Matusiewicz, Florian Mendel, Christian Rechberger, Martin Schläffer, and Søren S. Thomsen
  • JH - Hongjun Wu
  • Fugue - Shai Halevi, William E. Hall, and Charanjit S. Jutla
  • scrypt - Colin Percival
  • bcrypt - Niels Provos and David Mazières
  • X11, Hefty1, Quark creators (they just mixed together a bunch of the above algos)