{"_id":"binstring","_rev":"19-f9f299015b8757504e325116515fe186","name":"binstring","description":"Convert binary data to and from various string representations","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.0":{"name":"binstring","version":"0.1.0","description":"Convert binary data to and from various string representations","keywords":["string","strings","convert","hex","bytes"],"devDependencies":{"mocha":"1.*","terst":"0.0.1"},"repository":{"url":"https://github.com/cryptocoinjs/binstring","type":"git"},"main":"./lib/binstring.js","bugs":{"url":"https://github.com/cryptocoinjs/binstring/issues"},"homepage":"https://github.com/cryptocoinjs/binstring","_id":"binstring@0.1.0","dist":{"shasum":"96177304a320b70c543ace3d3c35fedcdc4787b5","tarball":"https://registry.npmjs.org/binstring/-/binstring-0.1.0.tgz","integrity":"sha512-AjwfA3gTT6iZN2qOwqF+gsBNwDcVf03WPsId3Nx03Tz1zXv+Fuh1f7f45dh4NV/m59/J3J1RBrxabRLINjOFaQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDeFj7xrNVVtczxtcKQ2URgoTbuR4N5fTByQX4VbrH8ZAiEA1prPw1B4LjuRV4PruF2jNwP6FfDnP5E4krqpFv3w7ps="}]},"_from":".","_npmVersion":"1.3.13","_npmUser":{"name":"midnightlightning","email":"boydb@midnightdesign.ws"},"maintainers":[{"name":"midnightlightning","email":"boydb@midnightdesign.ws"}]},"0.2.0":{"name":"binstring","version":"0.2.0","description":"Convert binary data to and from various string representations","keywords":["string","strings","convert","hex","bytes"],"devDependencies":{"mocha":"1.*","terst":"0.0.1"},"repository":{"url":"https://github.com/cryptocoinjs/binstring","type":"git"},"main":"./lib/binstring.js","bugs":{"url":"https://github.com/cryptocoinjs/binstring/issues"},"homepage":"https://github.com/cryptocoinjs/binstring","_id":"binstring@0.2.0","dist":{"shasum":"ba2c1526f4f568f86f0037d6757b6c2f467cceb9","tarball":"https://registry.npmjs.org/binstring/-/binstring-0.2.0.tgz","integrity":"sha512-zs4ASzLCqTDYJtEfTXSDezgVaPohoRGI2y2mKm5TBBjBWZO61IQhGsW9CYPXvoby330e0zRkMqRpxux6GWFl5g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCeGrsBtIPfUc9Rdg1a79SjIl8xNyGey+gkdM1uBqSzhQIhAOMRBdrgYyhNfJU7AKqCb83hOJLQJlAaLcHIIyOOIlCy"}]},"_from":".","_npmVersion":"1.3.13","_npmUser":{"name":"midnightlightning","email":"boydb@midnightdesign.ws"},"maintainers":[{"name":"midnightlightning","email":"boydb@midnightdesign.ws"},{"name":"jp","email":"jprichardson@gmail.com"}]},"0.2.1":{"name":"binstring","version":"0.2.1","description":"Convert binary data to and from various string representations","keywords":["string","strings","convert","hex","bytes"],"devDependencies":{"mocha":"1.*","terst":"0.1.0"},"repository":{"url":"https://github.com/cryptocoinjs/binstring","type":"git"},"main":"./lib/binstring.js","bugs":{"url":"https://github.com/cryptocoinjs/binstring/issues"},"homepage":"https://github.com/cryptocoinjs/binstring","_id":"binstring@0.2.1","dist":{"shasum":"8a174d301f6d54efda550dd98bb4cb524eacd75d","tarball":"https://registry.npmjs.org/binstring/-/binstring-0.2.1.tgz","integrity":"sha512-YRfQSbLfh9/icoxbrj2SCQFlRgzoaSbfhBgPHlgmnmV7W2IYaYhUimuSXaQglis7E6YDcz3XtQzwMaIkruQDOA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEzWn26xwHGKbHjVaoUsalTpTemIl5KyRwQB/EyJR28aAiBGxtQfnQ1XyFbdPJhT83CT1Qu/PmgCXXbnzABs9FfJQA=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"jp","email":"jprichardson@gmail.com"},"maintainers":[{"name":"midnightlightning","email":"boydb@midnightdesign.ws"},{"name":"jp","email":"jprichardson@gmail.com"},{"name":"sidazhang","email":"sidazhang89@gmail.com"}]}},"readme":"# BinString\n\nJavaScript component to convert to/from strings and byte arrays.\n\nAMD/CommonJS compatible.\n\n\n## Usage\n\nThis library exposes a single function that takes a data parameter and an options object. Set `options.in` and `options.out` to the format of the input and desired output. Possible values include:\n\n* `hex`: Hex-encoded string; two hexadecimal characters per byte\n* `binary`: Binary-encoded string (ASCII-encoded)\n* `utf8`: Binary-encoded string (UTF8-encoded)\n* `bytes`: Byte array; an array of numbers, each representing one byte of data\n* `buffer`: A Node.js native Buffer object\n\nThe default encoding for `options.out` is a buffer (`buffer`). The input format is duck-typed if it's an Array (`bytes`) or Buffer (`buffer`) or Number object. If it's a string, it's interpreted as `binary` unless it's prefixed by `0x` (then it's `hex`). If `options.in` is set, it overrides the automatic duck-typing of the input variable.\n\n```js\nvar conv = require('binstring');\n\nconsole.dir(conv('hello', { in:'binary' })); // No output encoding specified, defaults to Buffer; output: Buffer([104,101,108,108,111])\nconsole.dir(conv([104,101,108,108,111], { out:'hex' })); // No input encoding specified, auto-detected as Byte Array; output: 68656c6c6f\nconsole.dir(conv('hello', { in:'binary', out:'hex' })); // output: 68656c6c6f\n```\n\n## Test\n\nUnit tests are written in [Mocha](http://visionmedia.github.io/mocha/). To run the test suite, checkout the git repository, and from within the base folder run:\n\n```sh\n$ npm install --dev\n$ ./node_modules/mocha/bin/mocha\n```\n\n## References on JavaScript UTF-8 forced encoding\n(these sources are also included as PDFs in the repo in case the links go dead)\n\n- http://ecmanaut.blogspot.com/2006/07/encoding-decoding-utf8-in-javascript.html\n- http://hossa.in/2012/07/20/utf-8-in-javascript.html\n\n# License\n(MIT License)\n\nCopyright 2014, Brooks Boyd <boydb@midnightdesign.ws>","maintainers":[{"name":"midnightlightning","email":"boydb@midnightdesign.ws"},{"name":"sidazhang","email":"sidazhang89@gmail.com"},{"name":"nadav","email":"npm@shesek.info"},{"name":"jprichardson","email":"jprichardson@gmail.com"}],"time":{"modified":"2022-06-13T04:39:15.900Z","created":"2014-01-02T16:03:05.193Z","0.1.0":"2014-01-02T16:03:07.385Z","0.2.0":"2014-01-20T19:26:13.462Z","0.2.1":"2014-04-13T22:27:39.438Z"},"repository":{"url":"https://github.com/cryptocoinjs/binstring","type":"git"},"readmeFilename":"README.md","homepage":"https://github.com/cryptocoinjs/binstring","keywords":["string","strings","convert","hex","bytes"],"bugs":{"url":"https://github.com/cryptocoinjs/binstring/issues"},"users":{}}