# md5-hex

> Create a MD5 hash with hex encoding

Latest version **5.0.0** (published 2023-10-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install md5-hex
pnpm add md5-hex
yarn add md5-hex
bun add md5-hex
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2023-10-22 |
| First published | 2015-05-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=18 |
| Dependencies | 1 |
| Unpacked size | 4.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 46 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | hash, crypto, md5, hex, buffer, browser |

## Links

- npm: https://www.npmjs.com/package/md5-hex
- Repository: https://github.com/sindresorhus/md5-hex
- Homepage: https://github.com/sindresorhus/md5-hex#readme
- Issues: https://github.com/sindresorhus/md5-hex/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/md5-hex

## Dependencies (1)

- [blueimp-md5](https://npm.io/package/blueimp-md5.md) ^2.19.0

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 5.0.0 (latest) — 2023-10-22
- 4.0.0 — 2021-05-03
- 3.0.1 — 2019-07-11
- 3.0.0 — 2019-05-04
- 2.0.0 — 2017-01-13
- 1.3.0 — 2016-04-12
- 1.2.1 — 2016-01-13
- 1.2.0 — 2015-12-24
- 1.1.0 — 2015-09-22
- 1.0.2 — 2015-06-04
- 1.0.1 — 2015-05-23
- 1.0.0 — 2015-05-23

## README

# md5-hex

> Create a MD5 hash with hex encoding

*Please don't use MD5 hashes for anything sensitive!*

Works in the browser too, when used with a bundler (like Webpack, Rollup, Browserify).

Checkout [`hasha`](https://github.com/sindresorhus/hasha) if you need something more flexible.

## Install

```sh
npm install md5-hex
```

## Usage

```js
import fs from 'node:fs';
import md5Hex from 'md5-hex';

const buffer = fs.readFileSync('unicorn.png');

md5Hex(buffer);
//=> '1abcb33beeb811dca15f0ac3e47b88d9'
```

## API

### md5Hex(data)

#### data

Type: `Buffer | string | Array<Buffer | string>`

Prefer buffers as they're faster to hash, but strings can be useful for small things.

Pass an array instead of concatenating strings and/or buffers. The output is the same, but arrays do not incur the overhead of concatenation.

## Related

- [crypto-hash](https://github.com/sindresorhus/crypto-hash) - Tiny hashing module that uses the native crypto API in Node.js and the browser
- [hasha](https://github.com/sindresorhus/hasha) - Hashing made simple
- [hash-obj](https://github.com/sindresorhus/hash-obj) - Get the hash of an object

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