{"name":"metrohash","version":"2.4.1","description":"Node.js bindings for MetroHash hashing library","scripts":{"build":"node-gyp rebuild","rebuild":"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":"0523bf0a74e6081f1e246536e0bcc896ed7cf05a","bugs":{"url":"https://github.com/robertklep/node-metrohash/issues"},"homepage":"https://github.com/robertklep/node-metrohash#readme","_id":"metrohash@2.4.1","_npmVersion":"6.1.0","_nodeVersion":"8.9.3","_npmUser":{"name":"robertklep","email":"robert.klep@gmail.com"},"maintainers":[{"name":"robertklep","email":"robert.klep@gmail.com"}],"dist":{"integrity":"sha512-YIw4KmTwpA8761ThAMS6NwDAqfNqsYe8GYaaYO5GAzmSxFwwtbgED0tWPlyxAkP3Gd/l9iRpfhSACJRqBTY7jg==","shasum":"e916cffca5b8a62a4b40a57c52a9c1c717766dea","tarball":"http://registry-npm.ywwl.com/metrohash/download/metrohash-2.4.1.tgz","fileCount":21,"unpackedSize":66706,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbRbdyCRA9TVsSAnZWagAAv3oP/ilvi0IP108+X8KrZsIt\nmyLJ4K1abX72SzVAYayt5U/bVhEByqloRIPHCr3wK5NF90vsyMPLgK6dgrEN\nxPfUXfW4tcJBXSL4nGdLELlccI7NM6ZgOztMWIGqSC0nPXzmgcc4dm4iR4Gw\nYnbSZITcyQ1uR8b3kr4qARLZ/4DUlk3PxgGiR6p4UO6T6RUrly3Co+A9ZBdC\ntiCZg8m6+kxfgd6cSsZA+9pZP8x9njwOPvQlyg+oRI0+NPuElGoKr+/T+y3L\ndMfqfH1EceDTHhTBXOoucT7p/C/YOQ159JLJBOkXr22/dHCsc7y/q3eWWxCj\nIo4kxZa3Y/XeymnArytIbUYgIXkFObajxaO2tPfRxHCBDUiK8UOo+gD0SSiP\nYabUt5QjPj3LQ1uWRKCkMUSKELxO5PaRGBJqs0NHI3Ats3iqQUcG3T7WmnTD\nX+kg23puZQPNrmZuKvzE5R7YShsl6i7qK8/3gNcfKdQgI0ptxNHFGqXbrpqQ\nk+KRvlS3F1MFZVLolygqhpkEb206KHiQW592N0KWUAOHuHvD0MarD/LgEsS/\nTMuIghbNLa3ZuYwlcp6qOJfPnYccKlk7znfEBw64eUe4PH2zr5Qj/zQxCaE/\nNttyzLSysoLuapU4s+GCwWAJfmd1FdTWrf18e4mgb2ulpONBQNOmP5G1Jccz\nwp6l\r\n=DdFu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIELGl8QIXRABKa4aswXwfI2yknVWU7g4GBp22UuvMyIRAiArC5BifU1YkVNqzPFt9Qjj1W1FIzYNp43+/pGtPwiDyA=="}],"size":10800,"noattachment":false,"key":"/metrohash/-/metrohash-2.4.1.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/metrohash_2.4.1_1531295602453_0.13170619117579196"},"_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":1531295602535,"_cnpm_publish_time":1531295602535,"dist-tags":{"latest":"3.2.0"}}