{"_id":"z-algorithm","_rev":"3-a14e437876218eb58588b7875f22ce6c","name":"z-algorithm","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"z-algorithm","version":"1.0.0","description":"This algorithm finds all occurrences of a pattern in a text in linear time. Let length of text be n and of pattern be m, then total time taken is O(m + n) with linear space complexity.","main":"index.js","scripts":{"start":"node index.js","test":"jest"},"repository":{"type":"git","url":"git+https://github.com/karimation/z-algorithm.git"},"author":{"name":"“kerim","email":"“selmi.kerim@gmail.com\nnpm set init.author.email “selmi.kerim@gmail.com","url":"“http://www.karimation.com\nnpm set init.author.url “http://www.karimation.com"},"license":"MIT","bugs":{"url":"https://github.com/karimation/z-algorithm/issues"},"homepage":"https://github.com/karimation/z-algorithm#readme","keywords":["z-algorithm","pattern-searching-algorithm","filter-search-box","string","string-matching","string-compare","javascript","rn-strings-filter","rn-string-matching","rn-strig-compare","react-native"],"devDependencies":{"jest":"^23.1.0"},"gitHead":"1dc271109647effdf72000a2ba20e0e392bd88d1","_id":"z-algorithm@1.0.0","_npmVersion":"6.0.0","_nodeVersion":"8.0.0","_npmUser":{"name":"karimation","email":"selmi.kerim@gmail.com"},"dist":{"integrity":"sha512-vJLS17vSH9Llp+jW1YrfxZ9Y98+GJIycTS1U87nACMmtDoyZRD92PpkoTQeBu0G0WmUckEV0UpveoQKFBHiFaw==","shasum":"940bf7c7808dabf147b9528bb143503d4b8a2281","tarball":"https://registry.npmjs.org/z-algorithm/-/z-algorithm-1.0.0.tgz","fileCount":6,"unpackedSize":4887264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbH/T7CRA9TVsSAnZWagAAgeoP/jFjr55hX4KSttimxMVH\nMi1m5dM+7JhZQeCxtf+Q/GXoCOZ24sqYdJ6Rfz45ABnSzGfQ0osHUdUdqwu8\n+mMdM+fF9G0npg3R5ox/qhpz7lp4cjngTbKR8anphoh8iwdOM+3Gz9ILr47B\nbh5Auk1GL1sqRA1eq0woCdKuTXsWBfRopKZMm47NCmurqCkvz7m9oDx3Vyhq\nPkBA2wjELeGMsnDd1LhdeAe8q2XrJkECOl963/xwL81rYdfI3Fxm5LwhpUvt\nZEDdUgzHmXibihxbi9kt+aA+cmXFzfeKqTQTcwzh/+2T8fDoyx4afDbzL5fW\nIXE4wxDoWsNQhJkAVUVUlfgQCp6VEADSNFIOKnopCpDS+KRMT9huD36QcCnH\nh+lcJDU+21KXyZ0InX5QVZme4aRdMcGNGlG711xIC9+qcboBeKazT4DzSUDT\nsEDSDZJoQEk4Nqc36XmWJN1yAtUm2lzEI0pG3ihuNbW5q1xc3hCgrXZGUGCb\nJoBsfh46B9NccO5x5U8g/z7g2KQn2UA+z1XEwzq7F7gFrayJXED7Ijh7WmS3\n5obK4ecelbETlsShwsNU7Ip26lj6XGZ+HuiHlWl8eDHZnlu8gnrg1fA+CG+q\nSOiPRUoIICveXo1hBFAbGyD/ar4Nnubwz8uOg4Qm6NR2HdQvKc19QE5GS4Hy\nikc0\r\n=FKkt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG9RCtzwJ74azLfLrIYBy9A1uT3SfbKihHxzCbRK5TAJAiEAyKi30pNClwtK6LGRks02r5b9sw9lmcevcQUo/vF/BKA="}]},"maintainers":[{"name":"karimation","email":"selmi.kerim@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/z-algorithm_1.0.0_1528820986333_0.21717698373894545"},"_hasShrinkwrap":false},"1.0.1":{"name":"z-algorithm","version":"1.0.1","description":"This algorithm finds all occurrences of a pattern in a text in linear time. Let length of text be n and of pattern be m, then total time taken is O(m + n) with linear space complexity.","main":"index.js","scripts":{"start":"node index.js","test":"jest"},"repository":{"type":"git","url":"git+https://github.com/karimation/z-algorithm.git"},"author":{"name":"“kerim","email":"“selmi.kerim@gmail.com\nnpm set init.author.email “selmi.kerim@gmail.com","url":"“http://www.karimation.com\nnpm set init.author.url “http://www.karimation.com"},"license":"MIT","bugs":{"url":"https://github.com/karimation/z-algorithm/issues"},"homepage":"https://github.com/karimation/z-algorithm#readme","keywords":["z-algorithm","pattern-searching-algorithm","filter-search-box","string","string-matching","string-compare","javascript","rn-strings-filter","rn-string-matching","rn-strig-compare","react-native"],"devDependencies":{"jest":"^23.1.0"},"gitHead":"1dc271109647effdf72000a2ba20e0e392bd88d1","_id":"z-algorithm@1.0.1","_npmVersion":"6.0.0","_nodeVersion":"8.0.0","_npmUser":{"name":"karimation","email":"selmi.kerim@gmail.com"},"dist":{"integrity":"sha512-ehhPJaW7MIvTua5G05rCFbQRREQ6I7RDe5k2WJCf/u2GM+seOfZi7iVP8BFPaQbdWMJNOonZ9v86SzZdwLqqqw==","shasum":"2694f8217f4abb858cb6c8a12d7c9804c58e7058","tarball":"https://registry.npmjs.org/z-algorithm/-/z-algorithm-1.0.1.tgz","fileCount":6,"unpackedSize":4887264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbH/U9CRA9TVsSAnZWagAAuhQP/2s2HXuRPwuSOdrzWKL+\nKbNRU7rJhlhO0bG0QTqAuhBDs8P/0VTVZzZM1aIgwLnG2gNNsXxbnRUm3c6k\nlNqrRy6A+oUaqNuKvDGhiDY3Qir0bw1mG26wmPr0aHLxJ8Q7/M2mp1wj+LhV\nkuuz9xBnED9r4/yjM5IYAM/iYyd1Zr2AE4Mni+cuPhuBBh4C0FdsGicbJeHu\nUrpnBLVAuoc2c/tkpV2u2D2s4XXgOcQw+iycPuEihxVGVS0QOws/vKJ4BHXo\nQRURC3BpfPrvYyhC6wHP6IWWOkZIxEISGixHfgLvb6rYZ1aw1nkBUbV1RZEm\nYywEA13aJiCAjFf3iV7vebixRGBxxD/Gw71ijN9NWnGDdxZgZ4cYQvOqhEo/\nJ84H7aio4gotF+85ySMZbO5GqsCG6M6pt7Gw2ORklLlvtdd1ZS3dldNCvVR2\ncihW2HuxcM0FHG91DKlnZDqvlpySWKqHtXvuNjsX1o1uoSRd9Ht0Ca3OpvOR\nha3K9wuafvpI70AS2d/KzwhzAkSz3CJEjBQLqwcpigvs/R872dcWuPZUZrro\nNVRGXt4gas/J8k849F4lWP0iEh4hmlG+QYr180ep/uNbumE9Btm6nn3O4fM9\ntni5wmhReNrdPMiJi6TYZg2zVGYQ9K5qgYyJmhW9+AtgEFcD9tKveZG1eBFG\nll9I\r\n=f8xQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUVPzYdiK8PJ0I9sMrVWVWnczuudF6+2wHV5JoNRqgUgIhAOJAEaozEqG9Z73VRY8DsJuVgDSeXBEMZn08vtfShuv0"}]},"maintainers":[{"name":"karimation","email":"selmi.kerim@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/z-algorithm_1.0.1_1528821052460_0.10969860401914033"},"_hasShrinkwrap":false}},"time":{"created":"2018-06-12T16:29:46.333Z","1.0.0":"2018-06-12T16:29:46.651Z","modified":"2022-05-25T10:03:12.307Z","1.0.1":"2018-06-12T16:30:52.759Z"},"maintainers":[{"email":"karimationpingo@gmail.com","name":"selmi-karim"}],"description":"This algorithm finds all occurrences of a pattern in a text in linear time. Let length of text be n and of pattern be m, then total time taken is O(m + n) with linear space complexity.","homepage":"https://github.com/karimation/z-algorithm#readme","keywords":["z-algorithm","pattern-searching-algorithm","filter-search-box","string","string-matching","string-compare","javascript","rn-strings-filter","rn-string-matching","rn-strig-compare","react-native"],"repository":{"type":"git","url":"git+https://github.com/karimation/z-algorithm.git"},"author":{"name":"“kerim","email":"“selmi.kerim@gmail.com\nnpm set init.author.email “selmi.kerim@gmail.com","url":"“http://www.karimation.com\nnpm set init.author.url “http://www.karimation.com"},"bugs":{"url":"https://github.com/karimation/z-algorithm/issues"},"license":"MIT","readme":"# Z algorithm (Linear time pattern searching Algorithm)\n\nThis algorithm finds all occurrences of a pattern in a text in linear time. Let length of text be n and of pattern be m, then total time taken is O(m + n) with linear space complexity. \n\n<img src=\"screenshots/test.gif\"  />\n\nThe algorithm runs in linear time because we never compare character less than R and with matching we increase R by one so there are at most T comparisons. In mismatch case, mismatch happen only once for each i (because of which R stops), that’s another at most T comparison making overall linear complexity.\n\n## Install\n\n```bash\n\nnpm install z-algorithm --save\n\nor \n\nyarn install z-algorithm\n\n```\n\n# Running the tests\n\nyou need to install <a href=\"https://facebook.github.io/jest/docs/en/22.1/getting-started.html\">jest</a> \n\n```bash\n\nnpm test\n\nor \n\nyarn test\n\n```\n\n\n# Usage\n\n```js\n\nimport z from 'z-algorithm';\n\nlet result = z.search('Hello World', 'Hello'); \n\n```\n\n## Examples\n\n```js\n\nimport z from 'z-algorithm';\n        \nlet result = z.search('Hello World', 'Hello'); \n// result = [0]\n\nlet result = z.search('Google', 'o'); \n// result = [1,2]\n\nlet result = z.search('karimation', 'i'); \n// result = [3,7]   \n\n```\n\n\n# Author\n\nkerim selmi <a href=\"http://www.karimation.com\">karimation</a>\n# License\n\nThis project is licensed under the  <a href=\"LICENSE\">MIT License</a>\n","readmeFilename":"README.md"}