{"name":"metrohash","version":"2.4.2","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.10.0","node-gyp":"^3.6.2"},"devDependencies":{"chai":"^3.5.0","mocha":"^5.1.1"},"gitHead":"69c1610655418b823adcd0977278bbea2d2d6c79","bugs":{"url":"https://github.com/robertklep/node-metrohash/issues"},"homepage":"https://github.com/robertklep/node-metrohash#readme","_id":"metrohash@2.4.2","_npmVersion":"6.1.0","_nodeVersion":"8.9.3","_npmUser":{"name":"robertklep","email":"robert.klep@gmail.com"},"dist":{"integrity":"sha512-c5zmEcs+MZNDTkf3zncdO6k7YGYTraC6z+KOGukIar21D1sVNuMVvoY3WvT/9vjMoQWRq1ibnP53oj1fi973lw==","shasum":"25c18c6cd8521ae037b15784cda467afbc6b5973","tarball":"http://registry-npm.ywwl.com/metrohash/download/metrohash-2.4.2.tgz","fileCount":22,"unpackedSize":67298,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWGbqCRA9TVsSAnZWagAAEDwQAIO0V+dZNb32CLq6IYYa\nl78VyxfPXVfAODyPYtBieJq8x+AhSw3CvlHzu894KAJ2xALdvrfklMfopU8u\ntF/P5StYw38PANFnORAHaeBjfq1b3UqHpM6KZKlilqnwPWz928hBeqsj5SMP\nsl0G+/MxuwXTc/i2/lU9zKia50EVgtm5xQ1iO49T597QU5QaUwmQXYWNzM0l\nX9/GAMt20TWnV5tOzXyYNa8wuSLgpK6tSxVxUPt5sFslBezjv2ZoOYMkf7q3\n21ms78Ml2CuDRc5cPApcgznV7ADIeN/R/ll/dY8bjkkXx1H4f/J1kXv5Ku3Z\nS65RCie4/VS1mYapFS8B+6P/Y752452SMN1AaTfXKQ0Sg6LB49QBdrI1ZbCF\nrRMgLRBH716YpW509/cCkeobO8xs2JiUEpeSpEiAcVfkl1Ei47fpSSsdZpzf\nzWImaVq1LW0qXlP10qbycw3tDK6mDAT3+mGSXZeTU6VFJ9wL4IEMy/elbNvZ\n0PmAPjJRNCnax1USK+8u/hbpWBtFSEA+Yq3tqKHJz/oz322Wz9ZNR3gnYpUw\nKsaewiHvLl/FtjGSArqBEX1DdzV+LSDuWizF/y+HnQNUSYYEJC/FQZDAiI3R\n7MjRYkl2Kyzb7hZVyff0qDuGgghbkOhtEfdC6uFXKHC5cmimszjJSOUctBhi\n/8rS\r\n=Hs8n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEJ/fZjifVrXcck92SosSexQ/fgmHUJxnDhLrSk98RriAiArNUJwjUs+NmorrVcx0EsVK5oqeV7V7Vjpx0jiB0tsTA=="}],"size":11066,"noattachment":false,"key":"/metrohash/-/metrohash-2.4.2.tgz"},"maintainers":[{"name":"robertklep","email":"robert.klep@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/metrohash_2.4.2_1532520170751_0.24721589684118594"},"_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":1532520170859,"_cnpm_publish_time":1532520170859,"dist-tags":{"latest":"3.2.0"}}