{"name":"metrohash","version":"2.7.0","description":"Node.js bindings for MetroHash hashing library","scripts":{"build":"node-gyp rebuild","rebuild":"node-gyp rebuild","test":"mocha test.js","install":"node-gyp rebuild"},"main":"index.js","types":"index.d.ts","gypfile":true,"author":{"name":"Robert Klep","email":"robert@klep.name"},"repository":{"type":"git","url":"git+https://github.com/robertklep/node-metrohash.git"},"license":"MIT","dependencies":{"bindings":"^1.3.0","nan":"^2.13.2","node-gyp":"^3.8.0"},"devDependencies":{"chai":"^3.5.0","mocha":"^5.1.1"},"gitHead":"f5eb219d44c9290d1bd7908cb48383e8382e3c44","bugs":{"url":"https://github.com/robertklep/node-metrohash/issues"},"homepage":"https://github.com/robertklep/node-metrohash#readme","_id":"metrohash@2.7.0","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-4qu+r/ogRrk0Me4/bkJaFyZ+c8GlNQF1MGBGUxHPMKwQ0aNqeEv/szkQPPVk2b0ABNxYbrDePUpsE0uYXpOnMg==","shasum":"121bba8885c3a64baf23ca110f02586797f881b2","tarball":"http://registry-npm.ywwl.com/metrohash/download/metrohash-2.7.0.tgz","fileCount":21,"unpackedSize":67581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgu1DYCRA9TVsSAnZWagAAZ2kP+wZtR7v9SBAZpILg4JBn\nyVxJ85VuDqzmHWKp/WX1rHbJbXY6I0afLcVfRmidxyqHQhpb814YHA/Lpoki\neZSAqFj16EipCOl5R7CQrvyhmD66A+Y6jRlG9xDK7gqmG0iVGTavZoV0TYWw\nbngP4zmIav73EtZ+oP8gv936YeqXZ1HcDhu8/3tUPM1QEMtGBEib0zfs6oL2\nQXygyrVu7Giy6KC1IjWRqwHCUY4t/ylhwY1qKvsNCnbeV7Pktotx5GFbK/Kg\nJV26W0JOI1ERi+3QTjXsPFrId4TmtlayoY/U+ghL/4sd3iZCPNZs47B7AHF1\nJM4ZPpzHwjRSR4RNnA5WeLP8mHdRJVnfMFt1d/Auma9T2og5gE0IwjO061LA\ngrED4He9/Udd2q7DmZ2qG3hTsy48cZuWLnVCfM+4vZmqh0+/V7V8vuZ7pEzx\ntwsi6McAgYUH0/cEJHTPYw4jFkAOZOMDdqwf/s0/nv/eOUFDH9OBwenIk6fC\nwGTDd4ztCy82wDDcp9GbESITk/Hmh+UGwpN0SesssNIkXtWNwSizczl9ehgk\nstN6luJ6/ZxvKpNrm0J5f3Qlggldd+zY85ltCQlDegk8pWsWyLDzQQN6StIN\nua4rjstjRDCRZJz2Jp3y7HgsdjaqmpX33unapnTV1Cq+mXihtSMvD30mBFoc\nmpqq\r\n=+al1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBT2/DgyJweD/tTLtrfpMIgkLWjyviomumDWLCi5ygH7AiEAgjp/s/FCm/73PKPSCsx6IZqVVzHQBTw2AF+t/ZEYAus="}],"size":10924,"noattachment":false,"key":"/metrohash/-/metrohash-2.7.0.tgz"},"_npmUser":{"name":"robertklep","email":"robert.klep@gmail.com"},"directories":{},"maintainers":[{"name":"robertklep","email":"robert.klep@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/metrohash_2.7.0_1622888664723_0.5053681044425258"},"_hasShrinkwrap":false,"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":1622888664850,"_cnpm_publish_time":1622888664850,"dist-tags":{"latest":"3.2.0"}}