{"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","tarball":"http://registry-npm.ywwl.com/binary-case/download/binary-case-1.1.2.tgz","integrity":"sha512-HfuloAC3gLRrFfOWW81kwDKl3boKQMb0rs/oZjKGnhCLmkall1MbsV0NxW7w7qm7qM2nPgF05WeZZrmL+5tIYA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBicPLejHcZFpCIyRmcbBNHohot0TBa8xR1TLAXankTuAiEAlGUu7ONPfW/9HGX9UO5cDAPpoaGw3Sq2Jho3RjFOXC8="}],"size":10492,"noattachment":false,"key":"/binary-case/-/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":{},"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.","publish_time":1489439356007,"_cnpm_publish_time":1489439356007,"dist-tags":{"latest":"1.1.4"}}