ch128-node
v0.1.0
Published
Node.js bindings for cityhash-rs
Downloads
4
Maintainers
Readme
ch128-node
Node.js bindings for cityhash-rs.
Installation
npm install ch128-nodeUsage
const ch128 = require('ch128-node');
const data = Buffer.from('Hello, World!');
// CityHash v1.0.2
const hash102 = ch128.cityhash_102_128(data);
console.log(hash102.toString('hex')); // 16-byte hash
// CityHash v1.0.3
const hash103 = ch128.cityhash_103_128(data);
console.log(hash103.toString('hex')); // 16-byte hash
// CityHash v1.1.0
const hash110 = ch128.cityhash_110_128(data);
console.log(hash110.toString('hex')); // 16-byte hashAPI
cityhash_102_128(data)
- data:
Buffer- Input data to hash - Returns:
Buffer- 16-byte hash (128-bit)
Computes CityHash v1.0.2 128-bit hash.
cityhash_103_128(data)
- data:
Buffer- Input data to hash - Returns:
Buffer- 16-byte hash (128-bit)
Computes CityHash v1.0.3 128-bit hash.
cityhash_110_128(data)
- data:
Buffer- Input data to hash - Returns:
Buffer- 16-byte hash (128-bit)
Computes CityHash v1.1.0 128-bit hash.
Testing
npm testBuilding
npm run buildLicense
MIT
