{"id":28552312,"url":"https://github.com/stream-utils/hash-stream","last_synced_at":"2025-07-06T08:31:57.066Z","repository":{"id":10974005,"uuid":"13290724","full_name":"stream-utils/hash-stream","owner":"stream-utils","description":"Get a hash of a file or a stream","archived":false,"fork":false,"pushed_at":"2017-03-03T22:05:24.000Z","size":17,"stargazers_count":22,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-10T04:08:48.487Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stream-utils.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-03T05:00:14.000Z","updated_at":"2020-05-20T02:19:02.000Z","dependencies_parsed_at":"2022-09-03T00:20:18.621Z","dependency_job_id":null,"html_url":"https://github.com/stream-utils/hash-stream","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/stream-utils/hash-stream","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stream-utils%2Fhash-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stream-utils%2Fhash-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stream-utils%2Fhash-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stream-utils%2Fhash-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stream-utils","download_url":"https://codeload.github.com/stream-utils/hash-stream/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stream-utils%2Fhash-stream/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263870281,"owners_count":23522652,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-10T04:08:45.849Z","updated_at":"2025-07-06T08:31:57.060Z","avatar_url":"https://github.com/stream-utils.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hash Stream\n\n[![NPM version][npm-image]][npm-url]\n[![Build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n[![Dependency Status][david-image]][david-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\nSimple wrapper around `crypto.createHash()` for files and streams.\n\n## Installation\n\n```shell\n$ npm install hash-stream\n```\n\n## API\n\n```js\nvar getHash = require('hash-stream')\n```\n\n## getHash(filename || stream, algorithm, callback)\n\n- `filename` - path of the file\n- `stream` - a readable stream\n- `algorithm` - any defined by `crypto.getHashes()`\n\nReturns a `hash` as a raw `Buffer`, so if you want a hex:\n\n```js\ngetHash('image.png', 'sha256', function (err, hash) {\n  hash = hash.toString('hex')\n})\n```\n\n## [CLI](http://en.wikipedia.org/wiki/Command-line_interface)\n\nYou can use `nhash` to hash a file and get the output instantly. The usage options are simple:\n```\n$ nhash --help\nUsage: nhash [options] [file]\n\nOptions:\n\n  -h, --help              output usage information\n  -V, --version           output the version number\n  -a, --algorithm \u003csha1\u003e  the hash alorithm\n  -e, --encoding \u003chex\u003e    the encoding of output\n```\n\n[npm-image]: https://img.shields.io/npm/v/hash-stream.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/hash-stream\n[github-tag]: http://img.shields.io/github/tag/stream-utils/hash-stream.svg?style=flat-square\n[github-url]: https://github.com/stream-utils/hash-stream/tags\n[travis-image]: https://img.shields.io/travis/stream-utils/hash-stream.svg?style=flat-square\n[travis-url]: https://travis-ci.org/stream-utils/hash-stream\n[coveralls-image]: https://img.shields.io/coveralls/stream-utils/hash-stream.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/stream-utils/hash-stream\n[david-image]: http://img.shields.io/david/stream-utils/hash-stream.svg?style=flat-square\n[david-url]: https://david-dm.org/stream-utils/hash-stream\n[license-image]: http://img.shields.io/npm/l/hash-stream.svg?style=flat-square\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/hash-stream.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/hash-stream\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstream-utils%2Fhash-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstream-utils%2Fhash-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstream-utils%2Fhash-stream/lists"}