google-cityhash
Version:
Pure JavaScript implement for CityHash. (No C++ binding)
54 lines (35 loc) • 1.63 kB
Markdown
# CityHash for Node.js
[](https://www.npmjs.org/package/google-cityhash)
[](https://www.npmjs.org/package/google-cityhash)
[](https://github.com/BoogeeDoo/node-cityhash)
[](https://coveralls.io/github/BoogeeDoo/node-cityhash?branch=master)
[](https://www.npmjs.org/package/google-cityhash)
[](https://www.npmjs.org/package/google-cityhash)
[](https://github.com/BoogeeDoo/node-cityhash)
Pure JavaScript implement for CityHash. (No C++ binding)
## Installation
```bash
$ npm install --save google-cityhash
```
## Usage
```js
const hash = require('google-cityhash');
```
### CityHash 32
```js
const ret = hash.city32('text');
```
Returns a hash number.
### CityHash 64
```js
const ret = hash.city64('text');
```
Returns a [Long](https://npmjs.com/long) object.
### CityHash 128
```js
const ret = hash.city128('text');
```
Returns a [City128Value](https://github.com/XadillaX/bling_hashes_js/blob/master/lib/city128.d.ts) object.
## Contribution
You're welcome to make pull requests.
「雖然我覺得不怎麼可能有人會關注我」