# pull-hash

> pull-stream API for hashing data

Latest version **1.0.0** (published 2016-10-23) · Fair license · 0 weekly downloads

## Install

```sh
npm install pull-hash
pnpm add pull-hash
yarn add pull-hash
bun add pull-hash
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-10-23 |
| First published | 2016-03-21 |
| Weekly downloads | 0 |
| License | Fair |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Charles Lehner |
| Maintainers | cel |

## Links

- npm: https://www.npmjs.com/package/pull-hash
- Repository: https://github.com/clehner/pull-hash
- Homepage: https://github.com/clehner/pull-hash#readme
- Issues: https://github.com/clehner/pull-hash/issues
- npm.io page: https://npm.io/package/pull-hash

## Recent versions

- 1.0.0 (latest) — 2016-10-23
- 0.0.1 — 2016-03-23
- 0.0.0 — 2016-03-21

## README

# pull-hash

crypto hash API using [pull-stream][]s

```js
var hash = require('pull-hash')
var pull = require('pull-stream')

pull(
  source,
  hash('sha256', 'hex', function (err, sum) {
	console.log('shasum:', sum)
  }),
  pull.drain()
)
```

## API

```js
var hash = require('pull-hash')
```
#### `hash(type[, encoding], onEnd): through`

Create a through stream that hashes the data and calls `onEnd` when it is done.

- `type`: `crypto.Hash` object, or string to pass to `crypto.createHash`, e.g.
  `"sha256"`
- `encoding`: encoding for the digest to pass to `Hash.digest()`
- `onEnd(err, digest)`: callback with digest when stream is ended or errored

### Extras

```js
var gitHash = require('pull-hash/ext/git')
```
#### `gitHash(object[, encoding], onEnd): through`

Get a git object id.

- `object.type`: one of `["commit", "tree", "blob", "tag"]`
- `object.length || object.size`: size in bytes of the git object's data

```js
var ssbHash = require('pull-hash/ext/ssb')
```
#### `ssbHash(onEnd): through`

Get a hash id of a secure-scuttlebutt blob.

[secure-scuttlebutt]: https://github.com/ssbc/secure-scuttlebutt
[pull-stream]: https://github.com/dominictarr/pull-stream

## License

Copyright (c) 2016 Charles Lehner

Usage of the works is permitted provided that this instrument is
retained with the works, so that any entity that uses the works is
notified of this instrument.

DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.

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