{"_id":"sequential-hash","_rev":"237243","name":"sequential-hash","description":"A lexicographical ordered rolling hash","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"mafintosh","email":""}],"time":{"modified":"2023-03-24T16:34:00.000Z","created":"2015-03-02T00:59:57.764Z","1.0.0":"2015-03-02T00:59:57.764Z"},"users":{},"author":{"name":"Mathias Buus","url":"@mafintosh"},"repository":{"type":"git","url":"https://github.com/mafintosh/sequential-hash.git"},"versions":{"1.0.0":{"name":"sequential-hash","version":"1.0.0","description":"A lexicographical ordered rolling hash","main":"index.js","dependencies":{"lexicographic-integer":"^1.1.0"},"devDependencies":{"standard":"^2.10.0","tape":"^3.5.0"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/sequential-hash.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sequential-hash/issues"},"homepage":"https://github.com/mafintosh/sequential-hash","gitHead":"2c3ff5625304d96d6309953c43ac5b13b5838324","_id":"sequential-hash@1.0.0","_shasum":"b1ecb2acdd8f43ae9c892f5d155095d42d627d0c","_from":".","_npmVersion":"2.5.1","_nodeVersion":"1.3.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"maintainers":[{"name":"mafintosh","email":""}],"dist":{"shasum":"b1ecb2acdd8f43ae9c892f5d155095d42d627d0c","size":2394,"noattachment":false,"key":"/sequential-hash/-/sequential-hash-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/sequential-hash/download/sequential-hash-1.0.0.tgz"},"directories":{},"publish_time":1425257997764,"_hasShrinkwrap":false,"_cnpm_publish_time":1425257997764,"_cnpmcore_publish_time":"2021-12-17T00:24:30.295Z"}},"readme":"# sequential-hash\n\nA lexicographical ordered rolling hash\n\n```\nnpm install sequential-hash\n```\n\n[![build status](http://img.shields.io/travis/mafintosh/sequential-hash.svg?style=flat)](http://travis-ci.org/mafintosh/sequential-hash)\n\n## Usage\n\n``` js\nvar seqhash = require('sequential-hash')\nvar hash = seqhash('sha256') // sha256 is the hash algorithm\n\nvar prev = null\nvar words = ['mathias', 'wrote', 'this']\n\nwords.forEach(function (word) {\n  prev = hash(word, prev)\n  console.log(prev + ' -> ' + word)\n})\n```\n\nRunning the above produces\n\n```\n00!c1768bf97517f3da6948ee49b4d7078890c910a9fc07065a382184a4a3d9457a -> mathias\n01!f16200e82c592e37e0f938c12ba4b3d88aa61b1df873ab03b60932956211ec03 -> wrote\n02!34efbd1375266a04c302de321196d0a029bee922ca8044fe2cf8ca38289e3333 -> this\n```\n\n## API\n\n#### `hash = seqhash(algo)`\n\nCreate a rolling hash function based on a hash algorithm (`sha1`, `sha256`, etc)\n\n#### `hashString = hash(value, [previousHash])`\n\nHash a value based on a previous hash. The returned `hashString` is guaranteed to sort\nlexicographically higher than `previousHash`.\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/mafintosh/sequential-hash","bugs":{"url":"https://github.com/mafintosh/sequential-hash/issues"},"license":"MIT"}