{"_id":"binary-case","_rev":"244350","name":"binary-case","description":"Take a string and a number and perform binary case switching on alpha characters.","dist-tags":{"latest":"1.1.4"},"maintainers":[{"name":"gi60s","email":"james.speirs@gmail.com"}],"time":{"modified":"2021-06-03T16:01:42.000Z","created":"2016-11-08T18:38:36.964Z","1.1.4":"2018-03-23T19:51:25.579Z","1.1.3":"2017-03-13T21:29:42.346Z","1.1.2":"2017-03-13T21:09:16.007Z","1.1.1":"2017-03-13T21:03:32.617Z","1.1.0":"2017-03-13T20:42:24.598Z","1.0.0":"2016-11-08T18:38:36.964Z"},"users":{},"author":{"name":"James Speirs"},"repository":{"type":"git","url":"git+https://github.com/Gi60s/binary-case.git"},"versions":{"1.1.4":{"name":"binary-case","version":"1.1.4","description":"Take a string and a number and perform binary case switching on alpha characters.","main":"index.js","scripts":{"test":"nyc tape test.js && nyc report --reporter=text-lcov | coveralls"},"repository":{"type":"git","url":"git+https://github.com/Gi60s/binary-case.git"},"keywords":["case","letter","alpha"],"author":{"name":"James Speirs"},"license":"Apache-2.0","bugs":{"url":"https://github.com/Gi60s/binary-case/issues"},"homepage":"https://github.com/Gi60s/binary-case#readme","devDependencies":{"coveralls":"^2.11.14","nyc":"^8.4.0","tape":"^4.6.2"},"gitHead":"a53af5c542b936d6c1329895dd9b93556024d132","_id":"binary-case@1.1.4","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"gi60s","email":"james.speirs@gmail.com"},"dist":{"shasum":"d687104d59e38f2b9e658d3a58936963c59ab931","size":9316,"noattachment":false,"key":"/binary-case/-/binary-case-1.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/binary-case/download/binary-case-1.1.4.tgz"},"maintainers":[{"name":"gi60s","email":"james.speirs@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/binary-case_1.1.4_1521834685457_0.29341927948667923"},"_hasShrinkwrap":false,"publish_time":1521834685579,"_cnpm_publish_time":1521834685579},"1.1.3":{"name":"binary-case","version":"1.1.3","description":"Take a string and a number and perform binary case switching on alpha characters.","main":"index.js","scripts":{"test":"nyc tape test.js && nyc report --reporter=text-lcov | coveralls"},"repository":{"type":"git","url":"git+https://github.com/Gi60s/binary-case.git"},"keywords":["case","letter","alpha"],"author":{"name":"James Speirs"},"license":"Apache-2.0","bugs":{"url":"https://github.com/Gi60s/binary-case/issues"},"homepage":"https://github.com/Gi60s/binary-case#readme","devDependencies":{"coveralls":"^2.11.14","nyc":"^8.4.0","tape":"^4.6.2"},"gitHead":"ff37dadadba7373bc4fffe2f40ee353848441a37","_id":"binary-case@1.1.3","_shasum":"f91d0e3008f1fb0f4043d6594522d66d6d1c8409","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.2","_npmUser":{"name":"gi60s","email":"james.speirs@gmail.com"},"dist":{"shasum":"f91d0e3008f1fb0f4043d6594522d66d6d1c8409","size":10629,"noattachment":false,"key":"/binary-case/-/binary-case-1.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/binary-case/download/binary-case-1.1.3.tgz"},"maintainers":[{"name":"gi60s","email":"james.speirs@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/binary-case-1.1.3.tgz_1489440580356_0.49089555791579187"},"directories":{},"publish_time":1489440582346,"_cnpm_publish_time":1489440582346,"_hasShrinkwrap":false},"1.1.2":{"name":"binary-case","version":"1.1.2","description":"Take a string and a number and perform binary case switching on alpha characters.","main":"index.js","scripts":{"test":"nyc tape test.js && nyc report --reporter=text-lcov | coveralls"},"repository":{"type":"git","url":"git+https://github.com/Gi60s/binary-case.git"},"keywords":["case","letter","alpha"],"author":{"name":"James Speirs"},"license":"Apache-2.0","bugs":{"url":"https://github.com/Gi60s/binary-case/issues"},"homepage":"https://github.com/Gi60s/binary-case#readme","devDependencies":{"coveralls":"^2.11.14","nyc":"^8.4.0","tape":"^4.6.2"},"gitHead":"ed8adb85dcec05bd37ec1c29f5182b2b29501fa6","_id":"binary-case@1.1.2","_shasum":"5898235df7ab9fb1738f285ca655b3121ddd60f8","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.2","_npmUser":{"name":"gi60s","email":"james.speirs@gmail.com"},"dist":{"shasum":"5898235df7ab9fb1738f285ca655b3121ddd60f8","size":10492,"noattachment":false,"key":"/binary-case/-/binary-case-1.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/binary-case/download/binary-case-1.1.2.tgz"},"maintainers":[{"name":"gi60s","email":"james.speirs@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/binary-case-1.1.2.tgz_1489439354221_0.6161540444009006"},"directories":{},"publish_time":1489439356007,"_cnpm_publish_time":1489439356007,"_hasShrinkwrap":false},"1.1.1":{"name":"binary-case","version":"1.1.1","description":"Take a string and a number and perform binary case switching on alpha characters.","main":"index.js","scripts":{"test":"nyc tape test.js && nyc report --reporter=text-lcov | coveralls"},"repository":{"type":"git","url":"git+https://github.com/Gi60s/binary-case.git"},"keywords":["case","letter","alpha"],"author":{"name":"James Speirs"},"license":"Apache-2.0","bugs":{"url":"https://github.com/Gi60s/binary-case/issues"},"homepage":"https://github.com/Gi60s/binary-case#readme","devDependencies":{"coveralls":"^2.11.14","nyc":"^8.4.0","tape":"^4.6.2"},"gitHead":"99bee9eb2e557b3c735c50faec55bfd03dae6088","_id":"binary-case@1.1.1","_shasum":"776c5a0ffcec066c3eb06327c5d505196ce38720","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.2","_npmUser":{"name":"gi60s","email":"james.speirs@gmail.com"},"dist":{"shasum":"776c5a0ffcec066c3eb06327c5d505196ce38720","size":10482,"noattachment":false,"key":"/binary-case/-/binary-case-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/binary-case/download/binary-case-1.1.1.tgz"},"maintainers":[{"name":"gi60s","email":"james.speirs@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/binary-case-1.1.1.tgz_1489439010744_0.7414619941264391"},"directories":{},"publish_time":1489439012617,"_cnpm_publish_time":1489439012617,"_hasShrinkwrap":false},"1.1.0":{"name":"binary-case","version":"1.1.0","description":"Take a string and a number and perform binary case switching on alpha characters.","main":"index.js","scripts":{"test":"nyc tape test.js && nyc report --reporter=text-lcov | coveralls"},"repository":{"type":"git","url":"git+https://github.com/Gi60s/binary-case.git"},"keywords":["case","letter","alpha"],"author":{"name":"James Speirs"},"license":"Apache-2.0","bugs":{"url":"https://github.com/Gi60s/binary-case/issues"},"homepage":"https://github.com/Gi60s/binary-case#readme","devDependencies":{"coveralls":"^2.11.14","nyc":"^8.4.0","tape":"^4.6.2"},"gitHead":"69cff10726ccec188c5701328f40d7ab4422da1a","_id":"binary-case@1.1.0","_shasum":"e58562962134262bb993868c9e0327cd37a2f6c3","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"gi60s","email":"james.speirs@gmail.com"},"dist":{"shasum":"e58562962134262bb993868c9e0327cd37a2f6c3","size":10480,"noattachment":false,"key":"/binary-case/-/binary-case-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/binary-case/download/binary-case-1.1.0.tgz"},"maintainers":[{"name":"gi60s","email":"james.speirs@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/binary-case-1.1.0.tgz_1489437742609_0.20453489548526704"},"directories":{},"publish_time":1489437744598,"_cnpm_publish_time":1489437744598,"_hasShrinkwrap":false},"1.0.0":{"name":"binary-case","version":"1.0.0","description":"Take a string and a number and perform binary case switching on alpha characters.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/Gi60s/binary-case.git"},"keywords":["case","letter","alpha"],"author":{"name":"James Speirs"},"license":"Apache-2.0","bugs":{"url":"https://github.com/Gi60s/binary-case/issues"},"homepage":"https://github.com/Gi60s/binary-case#readme","devDependencies":{"tape":"^4.6.2"},"gitHead":"79888b2155ea009b37a8a91c0f30cc9b46e7bc33","_id":"binary-case@1.0.0","_shasum":"de68b495fca1c09913934c31ac7faf9861268617","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.2","_npmUser":{"name":"gi60s","email":"james.speirs@gmail.com"},"dist":{"shasum":"de68b495fca1c09913934c31ac7faf9861268617","size":8338,"noattachment":false,"key":"/binary-case/-/binary-case-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/binary-case/download/binary-case-1.0.0.tgz"},"maintainers":[{"name":"gi60s","email":"james.speirs@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/binary-case-1.0.0.tgz_1478630316381_0.2890779704321176"},"directories":{},"publish_time":1478630316964,"_cnpm_publish_time":1478630316964,"_hasShrinkwrap":false}},"readme":"[![NPM version](https://img.shields.io/npm/v/binary-case.svg?style=flat)](https://npmjs.org/package/binary-case)\n[![NPM downloads](https://img.shields.io/npm/dm/binary-case.svg?style=flat)](https://npmjs.org/package/binary-case)\n[![Build status](https://img.shields.io/travis/Gi60s/binary-case.svg?style=flat)](https://travis-ci.org/Gi60s/binary-case)\n[![Test coverage](https://img.shields.io/coveralls/Gi60s/binary-case.svg?style=flat)](https://coveralls.io/r/Gi60s/binary-case?branch=master)\n\n# binary-case\n\nTake a string and a number and perform binary case switching on alpha characters.\n\n## Example\n\n```js\nconst binaryCase = require('binary-case');\n\n// 3 in binary = 011\nconst number = 3;\n\n// 011 reversed to 110 so the first 2 characters will toggle case\nconst value = binaryCase('abc', 3);     // value: \"ABc\"\n```\n\n## Installation\n\n```sh\n$ npm install binary-case\n```\n\n## API\n\n### binaryCase ( string, number [, options ] ) : string | boolean\n\nTake a string and a number and perform binary case switching on alpha characters.\n\n**Parameters**\n\n- *string* - The string value to toggle alpha character cases on.\n\n- *number* - A number that will be converted to binary to determine case switching.\n\n- *options* - An optional object that defines options for the function.\n\n    - *allowOverflow* - Defaults to `true`. Set to `false` to have the `binaryCase` function return `false` when the number provided creates a binary string that is larger than the number of alpha characters in the string provided to be converted. Overflow will cause case switching sequences to repeat.\n\n        ```js\n        binaryCase('abc', 0);                               // 'abc'\n        binaryCase('abc', 8);                               // 'abc'\n        binaryCase('abc', 8, { allowOverflow: false });     // false\n        ```\n\n**Returns** a string if successful or `false` on failure.\n\n### binaryCase.iterator ( string [, options ] ) : object\n\nGet an iterator object that will allow iteration through all variations of the string's casing.\n\n**Parameters**\n\n- *string* - The string to produce case variations for.\n\n- *options* - An optional object that defines options for the iterator.\n\n    - *startIndex* - The number to start with for producing variations. This will reduce the total number of possible variations.\n\n**Returns** an object with a *next* property.\n\n**Example**\n\n```js\nconst iterator = binaryCase.iterator('abc');\niterator.next().value;  // 'abc'\niterator.next().value;  // 'Abc'\niterator.next().value;  // 'aBc'\niterator.next().value;  // 'ABc'\n```\n\n### binaryCase.maxNumber ( string ) : number\n\nDetermine the maximum number that can be used before causing repeating case variations.\n\n**Parameters**\n\n- *string* - The string value to count the number of possible case variations on.\n\n**Returns** a number.\n\nThis calculation is simple:\n\n1. Determine how many alpha characters exist in the string (a through z and A through Z)\n2. The result is 2 to the power of the number of alpha characters, minus 1.\n\nFor example: `abc` has 3 alpha characters. `2^3 - 1 = 7`\n\n### binaryCase.variations ( string ) : string[]\n\nGet an array of all possible case variations.\n\n**Parameters**\n\n- *string* - The string value to get case variations for.\n\n**Returns** an array of  strings.","_attachments":{},"homepage":"https://github.com/Gi60s/binary-case#readme","bugs":{"url":"https://github.com/Gi60s/binary-case/issues"},"license":"Apache-2.0"}