An open API service indexing awesome lists of open source software.

https://github.com/robertoachar/node-file-hash

Compute the md5, sha1 and sha256 hashs of a string or buffer.
https://github.com/robertoachar/node-file-hash

hash md5 node-js sha1 sha256

Last synced: 3 months ago
JSON representation

Compute the md5, sha1 and sha256 hashs of a string or buffer.

Awesome Lists containing this project

README

          

# Node File Hash

Generated by [OSS Project Generator](http://bit.ly/generator-oss-project).

[![Travis Status][travis-badge]][travis-url]
[![AppVeyor Status][appveyor-badge]][appveyor-url]
[![CircleCI Status][circleci-badge]][circleci-url]
[![Coveralls Status][coveralls-badge]][coveralls-url]
[![NPM Version][npm-badge]][npm-url]
[![License][license-badge]][license-url]

> Compute the md5, sha1 and sha256 hashs of a string or buffer.

# Installation

Install package

```bash
$ npm install --save node-file-hash
```

# Usage

```js
const lib = require('node-file-hash');

lib.createHash('Buffer')
.then((hash) => console.log(hash))
.catch((err) => console.error(err));
```

Output

```json
{
"md5": "7e62bc342f41c946868f0ea6f0b712d8",
"sha1": "2be5f64b36230104ef9c6e230215846a83d18df6",
"sha256": "e44193fd2d21722a46c8fcab041508d4c5be95a34828b72c631df53e8d7e20a6"
}
```

# Development

* Cloning the repo

```bash
$ git clone https://github.com/robertoachar/node-file-hash.git
```

* Installing dependencies

```bash
$ npm install
```

* Running scripts

Action | Usage
--- | ---
Starting development mode | `npm start`
Linting code | `npm run lint`
Running unit tests | `npm run jest`
Running code coverage | `npm run coverage`
Running lint + tests | `npm test`
Sending coverage results to Coveralls.io | `npm run coveralls`

# Author

[Roberto Achar](https://twitter.com/robertoachar)

# License

[MIT](https://github.com/robertoachar/node-file-hash/blob/master/LICENSE)

[travis-badge]: https://travis-ci.org/robertoachar/node-file-hash.svg?branch=master
[travis-url]: https://travis-ci.org/robertoachar/node-file-hash

[appveyor-badge]: https://ci.appveyor.com/api/projects/status/github/robertoachar/node-file-hash?branch=master&svg=true
[appveyor-url]: https://ci.appveyor.com/project/robertoachar/node-file-hash

[circleci-badge]: https://circleci.com/gh/robertoachar/node-file-hash/tree/master.svg?style=shield
[circleci-url]: https://circleci.com/gh/robertoachar/node-file-hash

[coveralls-badge]: https://coveralls.io/repos/github/robertoachar/node-file-hash/badge.svg?branch=master
[coveralls-url]: https://coveralls.io/github/robertoachar/node-file-hash?branch=master

[npm-badge]: https://img.shields.io/npm/v/node-file-hash.svg
[npm-url]: https://www.npmjs.com/package/node-file-hash

[license-badge]: https://img.shields.io/github/license/robertoachar/node-file-hash.svg
[license-url]: https://opensource.org/licenses/MIT