{"_id":"p-c","_rev":"8-f6b52f2bb2a6e740b5d22ba063920b55","name":"p-c","description":"permutation, combination and lot more.","dist-tags":{"blank":"1.0.0","latest":"1.0.5"},"versions":{"1.0.0":{"name":"p-c","version":"1.0.0","description":"permutation, combination and lot more.","main":"pc.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/logicy/p-c.git"},"keywords":["permutation;","combination;","name;","rank;"],"author":{"name":"Sushil Kumar Jain"},"license":"MIT","bugs":{"url":"https://github.com/logicy/p-c/issues"},"homepage":"https://github.com/logicy/p-c#readme","gitHead":"02bba1ce2c8deb943ce48904dbdca39f0790853a","_id":"p-c@1.0.0","_shasum":"d9ed33af5977241dc50d059992b66336590640b6","_from":".","_npmVersion":"2.15.0","_nodeVersion":"4.4.2","_npmUser":{"name":"sushiljainam","email":"sushiljain1993@gmail.com"},"dist":{"shasum":"d9ed33af5977241dc50d059992b66336590640b6","tarball":"https://registry.npmjs.org/p-c/-/p-c-1.0.0.tgz","integrity":"sha512-a0wHJk8tpGmMfFqUJC7oibx6t4z/NlbQyg+7onniGSvwWG7Q8VcQu8P9KP3fj9yO0VHL6tPnMJTakchD3VjsHw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBMtybWpx9pM5VscAOyXLk9CbnDR68NEJZzMDz8PZhdzAiEAj4LI5fFZde/bMf/g7LdDRUxARZhMxlhOL5o4zClsia4="}]},"maintainers":[{"name":"sushiljainam","email":"sushiljain1993@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/p-c-1.0.0.tgz_1487917005285_0.4549666631501168"}},"1.0.1":{"name":"p-c","version":"1.0.1","description":"permutation, combination and lot more.","main":"pc.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/logicy/p-c.git"},"keywords":["permutation","combination","name","rank"],"author":{"name":"Sushil Kumar Jain"},"license":"MIT","bugs":{"url":"https://github.com/logicy/p-c/issues"},"homepage":"https://github.com/logicy/p-c#readme","gitHead":"c5d9fbd1d51045a36eebf36a842ec7e9dccffecf","_id":"p-c@1.0.1","_shasum":"8ad8573e6f7c2de6acb14fcba979ba707d2bdc8c","_from":".","_npmVersion":"2.15.0","_nodeVersion":"4.4.2","_npmUser":{"name":"sushiljainam","email":"sushiljain1993@gmail.com"},"dist":{"shasum":"8ad8573e6f7c2de6acb14fcba979ba707d2bdc8c","tarball":"https://registry.npmjs.org/p-c/-/p-c-1.0.1.tgz","integrity":"sha512-JMqQpM0Iw3H7PCcT75//+2A1aCpmlaQunX9rK5aoQl5aNEdODLvpAk3RrhAuZwBsMx/ny1ZsxQhMhs9w2ioWMA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9RGQ7DGoN7N7FsMa/Jx0bRlU8ShCdRtrHfZv/FC0AQAIhAP1dG1LGoj1BCd92xzDj2RruTyzc0rSVgJrLLVagSMMT"}]},"maintainers":[{"name":"sushiljainam","email":"sushiljain1993@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/p-c-1.0.1.tgz_1487931926032_0.5253870952874422"}},"1.0.2":{"name":"p-c","version":"1.0.2","description":"permutation, combination and lot more.","main":"pc.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git+https://github.com/logicy/p-c.git"},"keywords":["permutation","combination","name","rank"],"author":{"name":"Sushil Kumar Jain"},"license":"MIT","bugs":{"url":"https://github.com/logicy/p-c/issues"},"homepage":"https://github.com/logicy/p-c#readme","gitHead":"b9605f689f86edccc5558e771f52ce2d5a9078a7","_id":"p-c@1.0.2","_shasum":"e75cfe301dd14d45c2e3fef98436aaca79636d3e","_from":".","_npmVersion":"2.15.0","_nodeVersion":"4.4.2","_npmUser":{"name":"sushiljainam","email":"sushiljain1993@gmail.com"},"dist":{"shasum":"e75cfe301dd14d45c2e3fef98436aaca79636d3e","tarball":"https://registry.npmjs.org/p-c/-/p-c-1.0.2.tgz","integrity":"sha512-928/6WkEcJb7sQU6qo0DPP/q7gGECrXICKzn1k3PAmgLjZJINyZzykzWdEGNmhB2Hpgo6F/U0PDjzKi9cfZjCg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDI2l7+IO3D9LxCPpZQx7z5BfGoqQPN7nAZ/suB8wXisAiAw9Spjrk7JgdOsb+I5SnHjoJeDNuRgSc+eavwdD/cK0g=="}]},"maintainers":[{"name":"sushiljainam","email":"sushiljain1993@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/p-c-1.0.2.tgz_1488267239511_0.5668956318404526"}},"1.0.3":{"name":"p-c","version":"1.0.3","description":"permutation, combination and lot more.","main":"pc.js","scripts":{"test":"node test.js","try":"node try.js"},"repository":{"type":"git","url":"git+https://github.com/logicy/p-c.git"},"keywords":["permutation","combination","name","rank"],"author":{"name":"Sushil Kumar Jain"},"license":"MIT","bugs":{"url":"https://github.com/logicy/p-c/issues"},"homepage":"https://github.com/logicy/p-c#readme","gitHead":"6cdf638c4b5451ab26b15580702e3f345db3f8fc","_id":"p-c@1.0.3","_shasum":"338b3c701d52be13ad6a1cb261740e68ce8d944c","_from":".","_npmVersion":"2.15.0","_nodeVersion":"4.4.2","_npmUser":{"name":"sushiljainam","email":"sushiljain1993@gmail.com"},"dist":{"shasum":"338b3c701d52be13ad6a1cb261740e68ce8d944c","tarball":"https://registry.npmjs.org/p-c/-/p-c-1.0.3.tgz","integrity":"sha512-uvK6Tomg7Vv8835dz16MbREymoI7c9EU1D81aoQImZ1sjcpDd95a4xKNeAAccoaCMqy5B+cQAvAAYCjom+UEMw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCO0dYC3xC9+0Rhc+a+nPfI8nQDixR/4UPwIvGMMbXqTgIhAJ3TAqj/iEYgyrP3d/ieQOWMrCCRvNx6LYxPBGMitGB+"}]},"maintainers":[{"name":"sushiljainam","email":"sushiljain1993@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/p-c-1.0.3.tgz_1488274765919_0.20546615030616522"}},"1.0.4":{"name":"p-c","version":"1.0.4","description":"permutation, combination and lot more.","main":"pc.js","scripts":{"test":"node test.js","start":"node try.js"},"repository":{"type":"git","url":"git+https://github.com/logicy/p-c.git"},"keywords":["permutation","combination","name","rank"],"author":{"name":"Sushil Kumar Jain"},"license":"MIT","bugs":{"url":"https://github.com/logicy/p-c/issues"},"homepage":"https://github.com/logicy/p-c#readme","gitHead":"5d184fcfd20553c3a17ebdfc06f5c77fae1c4673","_id":"p-c@1.0.4","_shasum":"bb71eef41114c067045e18e5962c073acde1b388","_from":".","_npmVersion":"2.15.0","_nodeVersion":"4.4.2","_npmUser":{"name":"sushiljainam","email":"sushiljain1993@gmail.com"},"dist":{"shasum":"bb71eef41114c067045e18e5962c073acde1b388","tarball":"https://registry.npmjs.org/p-c/-/p-c-1.0.4.tgz","integrity":"sha512-eRDNsGKH1wnAxdUMnGR7z3yuI2Z6zWKw597K25p57rPdMzmyD9JD+dsg4ev/mVU1yIaFwtgl5YM6DiQmSgjeAw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEY5+YVhtOeP/dYLzi3ypggU+Iic4UX5wBiox1Tg78SjAiEA95Fl3AQY6WRfka3O/tvQvV1EZ70oEGRsKnQgnrsq6YU="}]},"maintainers":[{"name":"sushiljainam","email":"sushiljain1993@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/p-c-1.0.4.tgz_1488275674436_0.8237787510734051"}},"1.0.5":{"name":"p-c","version":"1.0.5","description":"permutation, combination and lot more.","main":"pc.js","scripts":{"test":"node test.js","start":"node try.js","init":"node index.js"},"repository":{"type":"git","url":"git+https://github.com/logicy/p-c.git"},"keywords":["permutation","combination","name","rank"],"dependencies":{"express":"^4.13.3","body-parser":"^1.17.0"},"engines":{"node":"4.0.0"},"author":{"name":"Sushil Kumar Jain"},"license":"MIT","bugs":{"url":"https://github.com/logicy/p-c/issues"},"homepage":"https://github.com/logicy/p-c#readme","gitHead":"b89193ee71fce325f17df3416dbdab7b22e643c0","_id":"p-c@1.0.5","_shasum":"14b6bbb046991b7edd6959271cc1ab1b9030b5d0","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"sushiljainam","email":"sushiljain1993@gmail.com"},"dist":{"shasum":"14b6bbb046991b7edd6959271cc1ab1b9030b5d0","tarball":"https://registry.npmjs.org/p-c/-/p-c-1.0.5.tgz","integrity":"sha512-NpqZxWsvZ1H0wRIXPchP5yNLJVl9na5gP4yXSv+IeBd0Q2YBc2rqZc4bxvNpcNaESfMo1CzzVQUSO52GU6qo3g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjGZ/wA+cwlaxW5+6cqkGw8xIIAAjJgWQMDM05CvEmkQIgVJfVHCJdBZYrJKH3OFtDJbJBQm971Nb8zTXVUiIv0eI="}]},"maintainers":[{"name":"sushiljainam","email":"sushiljain1993@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/p-c-1.0.5.tgz_1488724372580_0.23341435752809048"}}},"readme":"# p-c\r\npermuations, combinations, rankName and lot more: (in development mode)\r\n**all use cases not completed yet**\r\n\r\n## Installation\r\n\r\n```\r\nnpm install p-c\r\n```\r\n## Testing (after installing)\r\n\r\n```\r\nnpm test\r\n```\r\n## Start using (after installing) (trying)\r\n\r\nyou can try as soon as you install the package with your own input. :smile:\r\n\r\n```\r\nnpm start\r\nnpm start <method> <input-string>\r\nnpm start rank rohan\r\nnpm start count rohan\r\nnpm start all rohan\r\nnpm start list rohan\r\n```\r\n\r\n## Usage\r\n\r\n```javascript\r\nvar pc = require('p-c');\r\n\r\npc('cab').list(); /* [ 'aaa', 'aab', 'aac', 'aba', 'abb', 'abc', 'aca', 'acb', 'acc', 'baa', 'bab', 'bac', 'bba',\r\n  'bbb', 'bbc', 'bca', 'bcb', 'bcc', 'caa', 'cab', 'cac', 'cba', 'cbb', 'cbc', 'cca', 'ccb', 'ccc' ] */\r\npc(10).list(); // [ '00', '01', '10', '11' ]\r\npc(['a','b']).list(); /* [ 'aa', 'ab', 'ba', 'bb' ] */\r\npc(['c','b']).list(); /* [ 'bb', 'bc', 'cb', 'cc' ] */\r\npc('cacb').list(); /* [ 'aaaa', 'aaab', 'aaac', 'aaba', 'aabb', 'aabc', 'aaca', 'aacb', 'aacc', 'abaa', 'abab', 'abac',\r\n ... ,\r\n 'cbbc', 'cbca', 'cbcb', 'cbcc', 'ccaa', 'ccab', 'ccac', 'ccba', 'ccbb', 'ccbc', 'ccca', 'cccb', 'cccc' ]\r\n 81 permutations */\r\n\r\npc('cab').rank(); // 19\r\npc('cacb').rank(); // 61\r\n\r\npc('cab').count(); // 27 (= 3^3)\r\npc('cacb').count(); // 81 (= 3^4)\r\n\r\nvar result = pc.permute('cab'); // returns an object\r\nresult.count();\r\nresult.rank();\r\n\r\nvar result = pc('cab'); // returns an object\r\nresult.count();\r\nresult.rank();\r\n\r\n//examples with length\r\npc('01', 3).list() // [ '000', '001', '010', '011', '100', '101', '110', '111' ]\r\npc('cbad', 2).list() // [ 'aa', 'ab', 'ac', 'ad', 'ba', 'bb', 'bc', 'bd', 'ca', 'cb', 'cc', 'cd', 'da', 'db', 'dc', 'dd' ]\r\n```\r\n## Notes\r\n\r\nall 3: `pc(args)`, `pc.permute(args)` & `pc.name(args)` are equivalent\r\n\r\n* args: param1\r\n* args: param1, len(number)\r\n* args: param1, opts(object)\r\n\r\n* param1: string // string or convertible to string\r\n* param1: array  // array of chars // joined using no seperator\r\n\r\n## Advanced\r\n\r\n```javascript\r\n//examples with opts\r\npc('cbad', {length:2, sortChars:false}); // [ 'cc', 'cb', 'ca', 'cd', 'bc', 'bb', 'ba', 'bd', 'ac', 'ab', 'aa', 'ad', 'dc', 'db', 'da', 'dd' ]\r\npc('cbad', {length:2, repeatChars:false}); // [ 'ab', 'ac', 'ad', 'ba', 'bc', 'bd', 'ca', 'cb', 'cd', 'da', 'db', 'dc' ]\r\npc('cbad', {length:2, sortChars:false, repeatChars:false}); // [ 'cb', 'ca', 'cd', 'bc', 'ba', 'bd', 'ac', 'ab', 'ad', 'dc', 'db', 'da' ]\r\n```\r\n\r\n\r\n## Defaults\r\n\r\n* repeatChars: true\r\n* sortChars: true\r\n* length: length of input string\r\n\r\n## Examples explained in AMAP detail\r\n\r\nAMAP: as much as possible :wink:\r\n\r\n1. `var string = 'cab'; pc(string).list();`\r\n\t* will produce same result if `string = 'cba'` or `'abc'` or `'acb'` ..\r\n\t* Objective: get an array of all the permutations made by characters (sorted) of input `string`\r\n\t* process:\r\n\t\t* save length of string\r\n\t\t* find distinct characters, sort these\r\n\t\t* repeat is ON\r\n\t\t* push permutations of saved length in array, return it\r\n* `var string = 'cab'; pc(string).rank();`\r\n\t* will **NOT** produce same result if `string = 'cba'` or `'abc'` or `'acb'` ..\r\n\t* Objective: find position of input `string` in such `list()`\r\n\t* notes:\r\n\t\t* other than string's length is not recommended\r\n\t\t* sortChars=false is highly discouraged, while `rank()`, BECAUSE you will get 1 always.\r\n","maintainers":[{"name":"sushiljainam","email":"sushiljain1993@gmail.com"}],"time":{"modified":"2022-06-23T05:42:36.533Z","created":"2017-02-24T06:16:45.909Z","1.0.0":"2017-02-24T06:16:45.909Z","1.0.1":"2017-02-24T10:25:26.636Z","1.0.2":"2017-02-28T07:34:00.065Z","1.0.3":"2017-02-28T09:39:27.672Z","1.0.4":"2017-02-28T09:54:35.007Z","1.0.5":"2017-03-05T14:32:53.236Z"},"homepage":"https://github.com/logicy/p-c#readme","keywords":["permutation","combination","name","rank"],"repository":{"type":"git","url":"git+https://github.com/logicy/p-c.git"},"author":{"name":"Sushil Kumar Jain"},"bugs":{"url":"https://github.com/logicy/p-c/issues"},"license":"MIT","readmeFilename":"README.md","users":{"nurulnabi":true}}