# tiny-sha256

> SHA-256 in 849 bytes (minified)

Latest version **1.0.2** (published 2014-11-09) · Public domain license · 0 weekly downloads

## Install

```sh
npm install tiny-sha256
pnpm add tiny-sha256
yarn add tiny-sha256
bun add tiny-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.0.2 |
| Published | 2014-11-09 |
| First published | 2014-09-23 |
| Weekly downloads | 0 |
| License | Public domain |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Geraint Luff |
| Maintainers | geraintluff |

## Links

- npm: https://www.npmjs.com/package/tiny-sha256
- npm.io page: https://npm.io/package/tiny-sha256

## Recent versions

- 1.0.2 (latest) — 2014-11-09
- 1.0.1 — 2014-11-07
- 1.0.0 — 2014-09-23

## README

# A small SHA-256 implementation for JavaScript

The goals of this project are:
* small size  - the minified version is only 849 bytes
* readability - the unminified code should be relatively easy to understand/review

Input must be an ASCII string - if character codes outside the range 0-255 are received, `undefined` is returned.

## In the browser

The code (`sha256.js` or `sha256.min.js`) defines the `sha256(string)` function, which returns the hexadecimal-encoded SHA-256 hash of the input string.

AMD is also supported - use `index.js` instead.

## In Node/CommonJS

If you're on Node, you should probably use the version from the built-in [`crypto` module](http://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm).

However, it is made available as a CommonJS module, including the source code for the minified version:

```javascript
var sha256 = require('tiny-sha256');

var jsCode = sha256.code + 'alert(sha256("hello!"));';
```

## License

This library is released as "public domain".  You can copy, modify, re-release and re-license, or incorporate into any other project without restriction of any kind.

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