nomp multi-hashing module for use with xzc (zcoin)
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
crypto
scryptjane
sha3
.gitignore
.travis.yml
Lyra2.c
Lyra2.h
Lyra2RE.c
Lyra2RE.h
Lyra2REV2.c
Lyra2REV2.h
Lyra2Z.c
Lyra2Z.h
README.md
Sponge.c
Sponge.h
bcrypt.c
bcrypt.h
binding.gyp
blake.c
blake.h
boolberry.cc
boolberry.h
cryptonight.c
cryptonight.h
fresh.c
fresh.h
fugue.c
fugue.h
groestl.c
groestl.h
hefty1.c
hefty1.h
index.js
keccak.c
keccak.h
multihashing.cc
nist5.c
nist5.h
package.json
quark.c
quark.h
qubit.c
qubit.h
scryptjane.c
scryptjane.h
scryptn.c
scryptn.h
sha1.c
sha1.h
sha256.h
shavite3.c
shavite3.h
skein.c
skein.h
stdint.h
whirlpoolx.c
whirlpoolx.h
x11.c
x11.h
x13.c
x13.h
x15.c
x15.h
zr5.c
zr5.h
zr5test.cpp

README.md

node-multi-hashing

Cryptocurrency hashing functions for node.js. Modified version by ocminer for use with xzc (zcoin) - lyra2rev2 is modified to only work with xzc

Algorithms

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

Usage

Use node v0.12+

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)