# simple-sha256

> Generate SHA-256 hashes (in Node and the Browser)

Latest version **1.1.0** (published 2021-01-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-sha256
pnpm add simple-sha256
yarn add simple-sha256
bun add simple-sha256
```

## 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.1.0 |
| Published | 2021-01-06 |
| First published | 2018-06-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 48 |
| Author | Feross Aboukhadijeh |
| Maintainers | feross |
| Keywords | browser, browserify, node, sha256, hash, sha-256 |

## Links

- npm: https://www.npmjs.com/package/simple-sha256
- Repository: https://github.com/feross/simple-sha256
- Issues: https://github.com/feross/simple-sha256/issues
- Funding: https://github.com/sponsors/feross
- npm.io page: https://npm.io/package/simple-sha256

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2021-01-06
- 1.0.1 — 2020-11-17
- 1.0.0 — 2018-06-05

## README

# simple-sha256 [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]

[travis-image]: https://img.shields.io/travis/feross/simple-sha256/master.svg
[travis-url]: https://travis-ci.org/feross/simple-sha256
[npm-image]: https://img.shields.io/npm/v/simple-sha256.svg
[npm-url]: https://npmjs.org/package/simple-sha256
[downloads-image]: https://img.shields.io/npm/dm/simple-sha256.svg
[downloads-url]: https://npmjs.org/package/simple-sha256
[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
[standard-url]: https://standardjs.com

### Generate SHA-256 hashes (in Node and the Browser)

In Node.js, this package uses [`crypto.createHash()`](https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm_options). In the browser, it uses [`crypto.subtle.digest()`](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest).

### install

```
npm install simple-sha256
```

### usage

Async (returns a `Promise`):

```js
const sha256 = require('simple-sha256')

init()

async function init () {
  const hash = await sha256('hey there')
  console.log(hash)
  // 74ef874a9fa69a86e091ea6dc2668047d7e102d518bebed19f8a3958f664e3da
}
```

Sync:

```js
const sha256 = require('simple-sha256')
console.log(sha256.sync('hey there'))
// 74ef874a9fa69a86e091ea6dc2668047d7e102d518bebed19f8a3958f664e3da
```

### see also

- [simple-sha1](https://www.npmjs.com/package/simple-sha1)

### license

MIT. Copyright (c) [Feross Aboukhadijeh](https://feross.org).

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