Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify it + improve readme #13

Merged
merged 4 commits into from
Dec 8, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,24 @@ NOTE: MacOS X users need to have XCode installed (provides gcc)
Installation with NPM
=====================

npm install mhash

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

Usage
=====
<pre>
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.
</pre>

<pre>
var hash = require("mhash").hash;
```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"));
</pre>
```


Supported Hashing Algorithms
Expand Down Expand Up @@ -95,7 +97,8 @@ See [Issue #1](https://github.com/Sembiance/node-mhash/issues/1) for more detail
Manual Installation
===================

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

```bash
git clone "https://github.com/Sembiance/node-mhash.git"
cd node-mhash
node-waf configure build
```
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
exports.hash = require("bindings")("mhash.node").hash;
module.exports = require("bindings")("mhash.node").hash;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ "name": "mhash",
"version": "1.0.0",
"version": "1.1.0",
"author": "Robert Schultz <robert@cosmicrealms.com>",
"description": "Provides 27 hashing algorithms: md5, md4, md2, sha1, sha256, whirlpool, crc32, etc. MacOS X requires Xcode to be installed.",
"main": "index",
Expand Down
4 changes: 2 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//console.log("Only works if you've done `npm install mhash`");
//var hash = require("mhash").hash;
//var hash = require("mhash");

var hash = require("./index").hash;
var hash = require("./index");
console.log(hash("md2", "testing"));

console.log("\nNext should be: 0c1e02ff");
Expand Down