Forked to provide Windows compatibility. Works on Node 8+
Clone or download
Pull request Compare This branch is 37 commits ahead of sumlnoether:master.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
crypto Cryptonight variant 2 support + tests (zone117x#64) Oct 15, 2018
scryptjane more Mar 30, 2014
sha3 Added initial x15 support Jun 27, 2014
tests Adding a really simple benchmark script to the tests folder Dec 15, 2018
.gitignore 📦 🚧 ⬆️ Changing over to CPP, installing nan and updating configuratio… Aug 13, 2017
.travis.yml Changing to only LTS releases https://github.com/nodejs/Release Sep 14, 2018
LICENSE Create LICENSE Oct 1, 2018
README.md Updated README.md Oct 15, 2018
appveyor.yml Let's try running the tests too appveyor Oct 9, 2018
bcrypt.c Rebasing back to https://github.com/zone117x/node-multi-hashing as it… Jul 5, 2018
bcrypt.h Rebasing back to https://github.com/zone117x/node-multi-hashing as it… Jul 5, 2018
binding.gyp Updating CN Turtle to latest planned version & adding support for CN … Dec 11, 2018
blake.c Allow varying input length with scrypt, scryptn and scryptjane Apr 19, 2014
blake.h Allow varying input length with scrypt, scryptn and scryptjane Apr 19, 2014
boolberry.cc Boolberry support Jun 3, 2014
boolberry.h Boolberry support Jun 3, 2014
c11.c Rebasing back to https://github.com/zone117x/node-multi-hashing as it… Jul 5, 2018
c11.h Rebasing back to https://github.com/zone117x/node-multi-hashing as it… Jul 5, 2018
cryptonight.c Cryptonight variant 2 support + tests (zone117x#64) Oct 15, 2018
cryptonight.h Rebasing back to https://github.com/zone117x/node-multi-hashing as it… Jul 5, 2018
cryptonight_dark.c Updating CN Turtle to latest planned version & adding support for CN … Dec 11, 2018
cryptonight_dark.h Updating CN Turtle to latest planned version & adding support for CN … Dec 11, 2018
cryptonight_dark_lite.c Updating CN Turtle to latest planned version & adding support for CN … Dec 11, 2018
cryptonight_dark_lite.h Updating CN Turtle to latest planned version & adding support for CN … Dec 11, 2018
cryptonight_fast.c Cryptonight variant 2 support + tests (zone117x#64) Oct 15, 2018
cryptonight_fast.h Rebasing back to https://github.com/zone117x/node-multi-hashing as it… Jul 5, 2018
cryptonight_lite.c Cryptonight variant 2 support + tests (zone117x#64) Oct 15, 2018
cryptonight_lite.h Rebasing back to https://github.com/zone117x/node-multi-hashing as it… Jul 5, 2018
cryptonight_soft_shell.c Adding CN Soft Shell Support Back in Dec 2, 2018
cryptonight_soft_shell.h Adding CN Soft Shell Support Back in Dec 2, 2018
cryptonight_turtle.c Updating CN Turtle to latest planned version & adding support for CN … Dec 11, 2018
cryptonight_turtle.h Adding support for CN Turtle Dec 2, 2018
cryptonight_turtle_lite.c Updating CN Turtle to latest planned version & adding support for CN … Dec 11, 2018
cryptonight_turtle_lite.h Updating CN Turtle to latest planned version & adding support for CN … Dec 11, 2018
fresh.c Initial FRESH support Jul 7, 2014
fresh.h Initial FRESH support Jul 7, 2014
fugue.c Initial fugue support Apr 19, 2014
fugue.h Initial fugue support Apr 19, 2014
groestl.c slight naming convention change Apr 21, 2014
groestl.h slight naming convention change Apr 21, 2014
hefty1.c Fix compiler warnings May 12, 2014
hefty1.h Initial hefty1 support Apr 19, 2014
index.js Rebasing back to https://github.com/zone117x/node-multi-hashing as it… Jul 5, 2018
keccak.c Initial shavite3 support Apr 19, 2014
keccak.h Initial shavite3 support Apr 19, 2014
multihashing.cc Updating CN Turtle to latest planned version & adding support for CN … Dec 11, 2018
nist5.c Added nist5 hashing Jun 14, 2014
nist5.h Added nist5 hashing Jun 14, 2014
package-lock.json Updating CN Turtle to latest planned version & adding support for CN … Dec 11, 2018
package.json Updating CN Turtle to latest planned version & adding support for CN … Dec 11, 2018
quark.c Fix compiler warnings & scrypt hashing with variable length Apr 19, 2014
quark.h Allow varying input length with scrypt, scryptn and scryptjane Apr 19, 2014
qubit.c Fix compiler warnings May 12, 2014
qubit.h Initial support for qubit Apr 19, 2014
scryptjane.c Rebasing back to https://github.com/zone117x/node-multi-hashing as it… Jul 5, 2018
scryptjane.h Allow varying input length with scrypt, scryptn and scryptjane Apr 19, 2014
scryptn.c Change scrypt so that N and R values can be specified Apr 25, 2014
scryptn.h Change scrypt so that N and R values can be specified Apr 25, 2014
sha1.c Create macros to make GCC's aligned instructions cross-platform compa… Jan 8, 2018
sha1.h rename SHA1COIN_H to SHA1_H Jun 14, 2014
sha256.h Fix compiler warnings & scrypt hashing with variable length Apr 19, 2014
shavite3.c Fix compiler warnings May 12, 2014
shavite3.h Initial shavite3 support Apr 19, 2014
skein.c Allocate buffers on stack rather than heap Apr 21, 2014
skein.h Allow varying input length with scrypt, scryptn and scryptjane Apr 19, 2014
stdint.h Init Mar 30, 2014
x11.c Allow varying input length with scrypt, scryptn and scryptjane Apr 19, 2014
x11.h Initial shavite3 support Apr 19, 2014
x13.c Initial x13 support May 29, 2014
x13.h Initial x13 support May 29, 2014
x15.c Added initial x15 support Jun 27, 2014
x15.h Added initial x15 support Jun 27, 2014

README.md

image

Master Build Status

Build Status Build status

Development Build Status

Build Status Build status

NPM

TurtleCoin-multi-hashing

Cryptocurrency hashing functions for NodeJS

Now with Windows support

Algorithms

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

Usage

Install

sudo apt-get nodejs nodejs-dev node-gyp npm
sudo ln -s /usr/bin/nodejs /usr/bin/node
npm install turtlecoin-multi-hashing

So far this native NodeJS addon can do the following hashing algorithms.

var multiHashing = require('turtlecoin-multi-hashing')
var Buffer = require('safe-buffer').Buffer

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)
  • PhearZero Michael J Feher
  • codebling CodeBling
  • Monero The Monero Project
  • TurtleCoin TurtleCoin Developers