# murmurhash32-node

> JavaScript implementation of the murmurhash algorithm - 32bit

Latest version **1.0.1** (published 2020-01-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install murmurhash32-node
pnpm add murmurhash32-node
yarn add murmurhash32-node
bun add murmurhash32-node
```

## 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.1 |
| Published | 2020-01-10 |
| First published | 2020-01-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 23 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | fengjun |
| Maintainers | zbone3 |
| Keywords | murmurhash, murmurhash-node, murmurhash32-node, murmurhash2, murmurhash3, murmurhash32 |

## Links

- npm: https://www.npmjs.com/package/murmurhash32-node
- Repository: https://github.com/flagUpDown/murmurhash-node
- Homepage: https://github.com/zbone3/murmurhash-node#readme
- Issues: https://github.com/zbone3/murmurhash-node
- npm.io page: https://npm.io/package/murmurhash32-node

## 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

- 1.0.1 (latest) — 2020-01-10

## README

# murmurhash32-node

NOTE: Forked from [murmurhash-node](https://github.com/flagUpDown/murmurhash-node)

Murmur哈希是一种非加密散列函数，适用于一般的基于散列的查找。

本库使用node.js实现murmurhash算法

## 下载

使用npm进行下载

```
npm install murmurhash32-node --save
```

## 使用

```javascript
const murmurhash32 = require('murmurhash-node').bit32;

// 实现了murmurhash的v1版本和v2版本，返回值为32位的整数类型
murmurhash32.v2('string'); // 1640947696
murmurhash32.v3('string'); // 2904652459
```

使用种子(seed)来改变返回结果，seed默认为0

```javascript
murmurhash32.v2('string', 0); // 1640947696
murmurhash32.v3('string', 0); // 2904652459

murmurhash32.v2('string', 49); // 405242662
murmurhash32.v3('string', 49); // 842324242
```

支持数字、中文或其他特殊字符

```javascript
murmurhash32.v2(123); // 2461496879
murmurhash32.v2('中国'); // 2187784768
murmurhash32.v2('!@#$%^&*()_+-='); // 1977745461
```

支持使用Buffer类型

```javascript
murmurhash32.v2(Buffer.from('7468697320697320612074c3a97374', 'hex')); // 346350001
murmurhash32.v2(Buffer.from('this is a tést')); // 346350001
murmurhash32.v2('this is a tést'); // 346350001
```

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