# mhash

> Provides 27 hashing algorithms: md5, md4, md2, sha1, sha256, whirlpool, crc32, etc. MacOS X requires Xcode to be installed.

Latest version **2.2.0** (published 2019-09-02) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install mhash
pnpm add mhash
yarn add mhash
bun add mhash
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.2.0 |
| Published | 2019-09-02 |
| First published | 2011-12-06 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.0 |
| Dependencies | 2 |
| Unpacked size | 3.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 38 |
| Author | Robert Schultz |
| Maintainers | sembiance |
| Keywords | hash, md5, sha, crc, whirlpool, haval, ripemd, gost, snefru, alder, tiger, crc32, crc32b, sha256, md4, md2 |

## Links

- npm: https://www.npmjs.com/package/mhash
- Repository: https://github.com/Sembiance/mhash
- Homepage: http://github.com/Sembiance/mhash
- Issues: https://github.com/Sembiance/mhash/issues
- npm.io page: https://npm.io/package/mhash

## Dependencies (2)

- [nan](https://npm.io/package/nan.md) ~2.14.0
- [bindings](https://npm.io/package/bindings.md) ~1.5.0

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 2.2.0 (latest) — 2019-09-02
- 2.1.12 — 2019-07-03
- 2.1.11 — 2019-03-24
- 2.1.10 — 2018-12-31
- 2.1.9 — 2017-12-05
- 2.1.8 — 2017-12-05
- 2.1.7 — 2017-12-05
- 2.1.6 — 2017-01-03
- 2.1.5 — 2016-11-08
- 2.1.4 — 2016-06-07
- 2.1.3 — 2015-11-25
- 2.1.2 — 2015-09-17
- 2.1.1 — 2015-09-17
- 2.1.0 — 2015-08-27
- 2.0.2 — 2015-08-18
- … 17 more at https://npm.io/package/mhash/versions

## README

Description
===========

Provides several hashing algorithms for [node.js](http://nodejs.org/) by binding to [mhash](http://mhash.sourceforge.net/)

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


Installation with NPM
=====================

```bash
npm install mhash --python=python2
```

May need to manually run first to build mhash dep:
```
./libmhash-config.sh
./libmhash-build.sh
```

Usage
=====

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

```javascript
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](https://github.com/Sembiance/node-mhash/issues/1) for more details.


Manual Installation
===================

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

---
_Source: https://npm.io/package/mhash · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
