Provides several hashing algorithms for node.js by binding to mhash. Includes support for 27 different hash algorithms including: md5, md4, md2, sha1, sha256, whirlpool, crc32, etc.
C++ Python JavaScript Shell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
deps/mhash Apply patch to fix build on musl Jul 7, 2017
.gitignore
LICENSE
README.md
binding.gyp Updated to support latest node version. Fixes #15 Feb 22, 2015
hashtestdata.png Updated to support latest node version. Fixes #15 Feb 22, 2015
index.js Change the way it works : require("mhash") return directly the hashin… Dec 8, 2014
libmhash-build.sh Updated node-mhash to support node v0.8 with node-gyp Jun 17, 2012
libmhash-config.sh Updated node-mhash to support node v0.8 with node-gyp Jun 17, 2012
mhash.cc
package.json Bumped nan dependency to latest version Dec 5, 2017
test.js Updated to latest nan version Sep 17, 2015
wscript Fixed the wscript the correct way to continue to support older versio… Dec 6, 2011

README.md

Description

Provides several hashing algorithms for node.js by binding to mhash

NOTE: MacOS X users need to have XCode installed (provides gcc)

Installation with NPM

npm install mhash --python=python2

Usage

Syntax: hash("algo-type", String || Buffer)
//First argument is a string, one of the supported algorihms below.
//Second argument can either be a String or a Buffer.
var hash = require("mhash");

console.log(hash("md2", "testing"));

Supported Hashing Algorithms

  • crc32

  • crc32b

  • md2

  • md4

  • md5

  • haval128

  • haval160

  • haval192

  • haval224

  • haval256

  • sha1

  • sha224

  • sha256

  • sha384

  • sha512

  • ripemd128

  • ripemd160

  • ripemd256

  • ripemd320

  • tiger128

  • tiger160

  • tiger192

  • gost

  • whirlpool

  • adler32

  • snefru128

  • snefru256

Known Issues

The crc32 and crc32b may not be what you expect due the way the mhash library computes these.

See Issue #1 for more details.

Manual Installation

git clone "https://github.com/Sembiance/mhash.git"
cd mhash
node-gyp configure build