Go to file
Lucas Jones 1661676bb5 Allocate buffers on stack rather than heap 2014-04-21 14:31:03 +01:00
scryptjane more 2014-03-30 04:12:48 -04:00
sha3 Initial hefty1 support 2014-04-19 21:46:10 +01:00
.travis.yml Added nMin and nMax config for scrypt-jane 2014-03-31 16:06:50 -06:00
README.md Fix typo in README.md 2014-04-18 01:36:00 +01: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 shavite3 support 2014-04-19 22:33:45 +01: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
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 Allocate buffers on stack rather than heap 2014-04-21 14:31:03 +01:00
groestl.h Allow varying input length with scrypt, scryptn and scryptjane 2014-04-19 19:27:09 +01:00
hefty1.c Allocate buffers on stack rather than heap 2014-04-21 14:31:03 +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 shavite3 support 2014-04-19 22:33:45 +01:00
package.json Update version number 2014-04-18 00:56:26 +01: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 Allocate buffers on stack rather than heap 2014-04-21 14:31:03 +01:00
qubit.h Initial support for qubit 2014-04-19 20:49:49 +01:00
scrypt.c Fix compiler warnings & scrypt hashing with variable length 2014-04-19 20:15:34 +01:00
scrypt.h Fix compiler warnings & scrypt hashing with variable length 2014-04-19 20:15:34 +01:00
scryptjane.c Allow varying input length with scrypt, scryptn and scryptjane 2014-04-19 19:27:09 +01:00
scryptjane.h Allow varying input length with scrypt, scryptn and scryptjane 2014-04-19 19:27:09 +01:00
scryptn.c Fix compiler warnings & scrypt hashing with variable length 2014-04-19 20:15:34 +01:00
scryptn.h Fix compiler warnings & scrypt hashing with variable length 2014-04-19 20:15:34 +01:00
sha256.h Fix compiler warnings & scrypt hashing with variable length 2014-04-19 20:15:34 +01:00
shavite3.c Allocate buffers on stack rather than heap 2014-04-21 14:31:03 +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

README.md

node-multi-hashing

Build Status

NPM

Cryptocurrency hashing functions for node.js.

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 ..... >

//Another example...
var hashedScryptData = multiHashing.scrypt(new Buffer(80));

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)