{"name":"metrohash","version":"2.4.0","description":"Node.js bindings for MetroHash hashing library","scripts":{"build":"node-gyp rebuild","test":"$(npm bin)/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":"8fd171cd8d453e47a72d6baadbdb75b35e53b62b","bugs":{"url":"https://github.com/robertklep/node-metrohash/issues"},"homepage":"https://github.com/robertklep/node-metrohash#readme","_id":"metrohash@2.4.0","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"robertklep","email":"robert.klep@gmail.com"},"maintainers":[{"name":"robertklep","email":"robert.klep@gmail.com"}],"dist":{"integrity":"sha512-C7igRFVBxSewinaMEBgYhnYnBXL0DslgVN7zXGsyetxh85GiBAxKdAc3EmdswCElPkuFJMzfox+S5raaXk0euw==","shasum":"de38ae97d56aa86c387cb55c0476685a088e067d","tarball":"http://registry-npm.ywwl.com/metrohash/download/metrohash-2.4.0.tgz","fileCount":22,"unpackedSize":66675,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa6YQdCRA9TVsSAnZWagAAfWgP/j3WXzwHLN/18oYiKt0G\npV9HFM71qSHwwz7TD65OrzCw0yqUvTMR2qL/dbsYAwaNhKa5QmBKGi5f/t4x\nozjt0/TstjlHfD+h6H5sRB78rDmRsnqK0ZcXYzEaWCsbgP+R0uPTIYVO2Tlf\nLHbgY4atyLRuxcGiFYjTyDH1hJxOpBgbVbMosz/nB87dXlZ7um7Ecwqf9Uws\nUqKxTYIWeP5+ZhXtVUdjsNnbvGFe9kpSghzBEayxtcURcG8acxb6YwCRSPPs\nf+t221FfnkXLV9rcAuHbCb4xQJDSyi3lCGFfE8ba71e3nPhh5Ux4zQmM9Mir\n073M1BmCluqUppTGcIPruSsP1Ot3X1OK6JFbqfcbnGyeCjGNqk5QWq8pPlol\nSgefyGTuBvt62KE6j9q8/Iesji/fxgAS6vZdoy2PgX3Cv9C06XCCLItnxE/+\nDWh0+9dQv0EJIYEyGGhDL4SSTi46g1kAoD+HPSWG4lgBflvAjysHYfv6tCxb\nqPq8HlcuwsRk2SwADCnL5/rikvZ8tVKJaMHWn0pAZHVbVJguR9y18hE9SEXP\nrlL4t7hH3vO0vn3Dy4pUHDruQgh/2l+ptvQkhvhiETPycBPAzTZ5y9tNd20+\nxZ4u2oakrmMC6EoAqq54eWkn1CvsVYQKem+GrN2dIomi0X/dPK6SWGqfrlc4\nhJIF\r\n=sCO4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAyf590Gnv7qyV8elmN8NgNZZkAuWlr0SCA3i3gdr3OTAiEAiGQWp28Fry1EkR1GxsaPC6+ip09HSsjHYiy42mGpUBE="}],"size":10986,"noattachment":false,"key":"/metrohash/-/metrohash-2.4.0.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/metrohash_2.4.0_1525253148764_0.028656895658841552"},"_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":1525253148863,"_cnpm_publish_time":1525253148863,"dist-tags":{"latest":"3.2.0"}}