{"name":"metrohash","version":"3.1.0","author":{"name":"Robert Klep","email":"robert@klep.name"},"license":"MIT","_id":"metrohash@3.1.0","maintainers":[{"name":"robertklep","email":"robert.klep@gmail.com"}],"homepage":"https://github.com/robertklep/node-metrohash#readme","bugs":{"url":"https://github.com/robertklep/node-metrohash/issues"},"dist":{"shasum":"d0c485e51d76214722e788db803712890b2fc655","tarball":"http://registry-npm.ywwl.com/metrohash/download/metrohash-3.1.0.tgz","fileCount":21,"integrity":"sha512-n57G4Vr47tHoPPhXq+lE2W8S4UHBtRWI7F+thrhoVcvLT6bK/kLObbNHZ8m6tjNnHU40Z+GTJSgtXel02bDBVg==","signatures":[{"sig":"MEUCIA8PQoS0i4iMKfuwQnSM6RTMppa1ltBR2sm6zRm+9j8aAiEAuQPMVvZFPQFVwypCvWt3xJi/MUFhpggunvfWkB47368=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":68348,"size":11198,"noattachment":false,"key":"/metrohash/-/metrohash-3.1.0.tgz"},"main":"index.js","types":"index.d.ts","gitHead":"161a77bb813c33b05c43199d616cc35ae08d7cd4","gypfile":true,"scripts":{"test":"mocha test.js","build":"node-gyp rebuild","install":"node-gyp rebuild","rebuild":"node-gyp rebuild"},"_npmUser":{"name":"robertklep","email":"robert.klep@gmail.com"},"repository":{"url":"git+https://github.com/robertklep/node-metrohash.git","type":"git"},"_npmVersion":"11.3.0","description":"Node.js bindings for MetroHash hashing library","directories":{},"_nodeVersion":"24.2.0","dependencies":{"nan":"^2.25.0","bindings":"^1.5.0","node-gyp":"^10.3.1"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^3.5.0","mocha":"^11.0.1"},"_npmOperationalInternal":{"tmp":"tmp/metrohash_3.1.0_1773730683126_0.5887588982932996","host":"s3://npm-registry-packages-npm-production"},"readme":"# node-metrohash\n\nWrapper around [MetroHash](https://github.com/jandrewrogers/MetroHash).\n\n[![Build Status](https://travis-ci.org/robertklep/node-metrohash.svg)](https://travis-ci.org/robertklep/node-metrohash)\n[![Build status](https://ci.appveyor.com/api/projects/status/49944yng9l70q41k/branch/master?svg=true)](https://ci.appveyor.com/project/robertklep/node-metrohash/branch/master)\n\n### Installation\n\n```\n$ npm install metrohash\n```\n\n### API change!\n\nBetween v1 and v2, the API for this library has changed to allow for maximum hashing speed.\n\nThe biggest change is that a calculated hash is now returned as a (hex-encoded) string instead of a `Buffer`.\n\nIf a `Buffer` is still required, it's easy to convert the string:\n\n```\nlet buffer = Buffer.from(metrohash64('input'), 'hex');\n```\n\nAlso, the `.hash()` methods for the hasher classes have been removed in favor of standalone functions (see below).\n\n### Usage\n\nThe module exports 2 classes, `MetroHash64` and `MetroHash128`, and two functions, `metrohash64` and `metrohash128`.\n\nThe classes are meant for incremental hashing, the functions for standalone hash calculations.\n\nThe class constructors and functions accept an optional `seed` numerical argument, which defaults to `0`.\n\n#### Class interface\n\n``` javascript\nconst MetroHash64 = require('metrohash').MetroHash64;\n\n// Constructor.\nMetroHash64(seed? : number) : this\n\n// Update.\nMetroHash64#update(input : String | Buffer) : this\n\n// Finalize and get hash digest.\nMetroHash64#digest() : String\n```\n\n(likewise for `MetroHash128`).\n\n#### Function interface\n\n```\nconst metrohash64 = require('metrohash').metrohash64;\n\nmetrohash64(input : String | Buffer, seed? : number) : String\n```\n\n(likewise for `metrohash128`).\n\n### Examples\n\n``` javascript\n//// Classes\n\nconst MetroHash64 = require('metrohash').MetroHash64;\n\n// Instantiate using seed 123 (`new` is optional).\nlet hash = new MetroHash64(123);\n\n// Update using a string as input.\nhash.update('Hello, World!');\n\n// The same as above:\n// hash.update('Hello, ').update('World!');\n\n// Finalize to get the digest as a hex string.\nlet digest = hash.digest();\n\n//// Functions\nconst metrohash64 = require('metrohash').metrohash64;\n\nlet digest = metrohash64('Hello, World!', 123);\n```\n\n### Speed\n\nFrom v2.0 onwards, MetroHash is [pretty fast](https://medium.com/@drainingsun/in-search-of-a-good-node-js-hashing-algorithm-8052b6923a3b).\n","publish_time":1773730683264,"_cnpm_publish_time":1773730683264,"dist-tags":{"latest":"3.2.0"}}