{"versions":{"1.2.3":{"name":"bytewise-core","version":"1.2.3","description":"Binary serialization of arbitrarily complex structures that sort element-wise","main":"index.js","scripts":{"test":"tape test | faucet"},"repository":{"type":"git","url":"git+https://github.com/deanlandolt/bytewise-core.git"},"keywords":["binary","sort","collation","serialization","leveldb","indexeddb"],"author":{"name":"Dean Landolt","email":"dean@deanlandolt.com"},"license":"MIT","bugs":{"url":"https://github.com/deanlandolt/bytewise/issues"},"homepage":"https://github.com/deanlandolt/bytewise-core","dependencies":{"typewise-core":"^1.2"},"devDependencies":{"faucet":"0.0.1","tape":"^1.0"},"gitHead":"405c5c3f334c1b1ea3aab1a790d3354809c46f6d","_id":"bytewise-core@1.2.3","_shasum":"3fb410c7e91558eb1ab22a82834577aa6bd61d42","_from":".","_npmVersion":"2.11.1","_nodeVersion":"0.10.35","_npmUser":{"name":"anonymous","email":"dean@deanlandolt.com"},"maintainers":[{"name":"anonymous","email":"dean@deanlandolt.com"}],"dist":{"shasum":"3fb410c7e91558eb1ab22a82834577aa6bd61d42","size":9645,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/bytewise-core/-/bytewise-core-1.2.3.tgz","integrity":"sha512-nZD//kc78OOxeYtRlVk8/zXqTB4gf/nlguL1ggWA8FuchMyOxcyHR4QPQZMUmA7czC+YnaBrPUCubqAWe50DaA=="},"directories":{},"publish_time":1434748679646,"_hasShrinkwrap":false,"_cnpm_publish_time":1434748679646,"_cnpmcore_publish_time":"2021-12-13T19:14:24.168Z","contributors":[]},"1.2.2":{"name":"bytewise-core","version":"1.2.2","description":"Binary serialization of arbitrarily complex structures that sort element-wise","main":"index.js","scripts":{"test":"tape test | faucet"},"repository":{"type":"git","url":"git+https://github.com/deanlandolt/bytewise-core.git"},"keywords":["binary","sort","collation","serialization","leveldb","indexeddb"],"author":{"name":"Dean Landolt","email":"dean@deanlandolt.com"},"license":"MIT","bugs":{"url":"https://github.com/deanlandolt/bytewise/issues"},"homepage":"https://github.com/deanlandolt/bytewise-core","dependencies":{"typewise-core":"^1.2"},"devDependencies":{"faucet":"0.0.1","tape":"^1.0"},"gitHead":"c5eaa55983d3377946502686c12f2fcfaf462229","_id":"bytewise-core@1.2.2","_shasum":"da342754d27e3663881fef9dfdcbb61d5e8f57bf","_from":".","_npmVersion":"2.11.1","_nodeVersion":"0.10.35","_npmUser":{"name":"anonymous","email":"dean@deanlandolt.com"},"maintainers":[{"name":"anonymous","email":"dean@deanlandolt.com"}],"dist":{"shasum":"da342754d27e3663881fef9dfdcbb61d5e8f57bf","size":9658,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/bytewise-core/-/bytewise-core-1.2.2.tgz","integrity":"sha512-tVCcDhXl4APvgT/kfvezRSymnHI7iadxigzYEiyT2tTv8SuWaDfeXY4lF/VFWdMEPOQVAZemZxwKgl0BOMXfMw=="},"directories":{},"publish_time":1434677969817,"_hasShrinkwrap":false,"_cnpm_publish_time":1434677969817,"_cnpmcore_publish_time":"2021-12-13T19:14:24.392Z","contributors":[]},"1.2.1":{"name":"bytewise-core","version":"1.2.1","description":"Binary serialization of arbitrarily complex structures that sort element-wise","main":"index.js","scripts":{"test":"tape test | faucet"},"repository":{"type":"git","url":"https://github.com/deanlandolt/bytewise-core.git"},"keywords":["binary","sort","collation","serialization","leveldb","indexeddb"],"author":{"name":"Dean Landolt","email":"dean@deanlandolt.com"},"license":"MIT","bugs":{"url":"https://github.com/deanlandolt/bytewise/issues"},"homepage":"https://github.com/deanlandolt/bytewise-core","dependencies":{"typewise-core":"^1.2"},"devDependencies":{"faucet":"0.0.1","tape":"^1.0"},"gitHead":"a487bd4e480582672ed719bc0c260bbc05a7d3c1","_id":"bytewise-core@1.2.1","_shasum":"dbc950cdda149fc6d510d5c209ac07b8a270f193","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"anonymous","email":"dean@deanlandolt.com"},"maintainers":[{"name":"anonymous","email":"dean@deanlandolt.com"}],"dist":{"shasum":"dbc950cdda149fc6d510d5c209ac07b8a270f193","size":9509,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/bytewise-core/-/bytewise-core-1.2.1.tgz","integrity":"sha512-IOOBJByGuRdBXl68I0RbJYwD6jlesUM3J4IxchNtgApiz7ftrVsczhD+0UkdQbRofVp/FYxuyn8LL43JH9lq2w=="},"directories":{},"publish_time":1431591586715,"_hasShrinkwrap":false,"_cnpm_publish_time":1431591586715,"_cnpmcore_publish_time":"2021-12-13T19:14:24.604Z","contributors":[]},"1.2.0":{"name":"bytewise-core","version":"1.2.0","description":"Binary serialization of arbitrarily complex structures that sort element-wise","main":"index.js","scripts":{"test":"tape test | faucet"},"repository":{"type":"git","url":"https://github.com/deanlandolt/bytewise-core.git"},"keywords":["binary","sort","collation","serialization","leveldb","indexeddb"],"author":{"name":"Dean Landolt","email":"dean@deanlandolt.com"},"license":"MIT","bugs":{"url":"https://github.com/deanlandolt/bytewise/issues"},"homepage":"https://github.com/deanlandolt/bytewise-core","dependencies":{"typewise-core":"^1.2"},"devDependencies":{"faucet":"0.0.1","tape":"^1.0"},"gitHead":"5c4258b84ca5cefc5fb58e8344b307e14d6735dd","_id":"bytewise-core@1.2.0","_shasum":"2d29d620fff10bf3c23d84be8eb092f2c470acbf","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"anonymous","email":"dean@deanlandolt.com"},"maintainers":[{"name":"anonymous","email":"dean@deanlandolt.com"}],"dist":{"shasum":"2d29d620fff10bf3c23d84be8eb092f2c470acbf","size":8838,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/bytewise-core/-/bytewise-core-1.2.0.tgz","integrity":"sha512-WFk5sDa4WY5rp3d4c+gqjkatq+mKO8TIgF4VYtnZ+I9k3YzPJkJ3HKY9ofYooh9LFPlSdWzSUAN3K2lYJyocbQ=="},"directories":{},"publish_time":1431480641051,"_hasShrinkwrap":false,"_cnpm_publish_time":1431480641051,"_cnpmcore_publish_time":"2021-12-13T19:14:24.809Z","contributors":[]},"1.1.2":{"name":"bytewise-core","version":"1.1.2","description":"Binary serialization of arbitrarily complex structures that sort element-wise","main":"index.js","scripts":{"test":"tape test | faucet"},"repository":{"type":"git","url":"https://github.com/deanlandolt/bytewise-core.git"},"keywords":["binary","sort","collation","serialization","leveldb","indexeddb"],"author":{"name":"Dean Landolt","email":"dean@deanlandolt.com"},"license":"MIT","bugs":{"url":"https://github.com/deanlandolt/bytewise/issues"},"homepage":"https://github.com/deanlandolt/bytewise-core","dependencies":{"typewise-core":"^1.1"},"devDependencies":{"faucet":"0.0.1","tape":"^1.0"},"gitHead":"89a93c891c048e55305a819a992108d3dbe1f2cf","_id":"bytewise-core@1.1.2","_shasum":"0d646277386c7cd3d732177effbb61229766970c","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"anonymous","email":"dean@deanlandolt.com"},"maintainers":[{"name":"anonymous","email":"dean@deanlandolt.com"}],"dist":{"shasum":"0d646277386c7cd3d732177effbb61229766970c","size":8394,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/bytewise-core/-/bytewise-core-1.1.2.tgz","integrity":"sha512-0UIUlRfYrh8uPBkJsjG5wuB8FbkUkSeRjBJMyxcdluXo3w02gYE6/oQnor4CemJeYwIN7ZmhbChpjNU+oLOvEg=="},"directories":{},"publish_time":1431374098612,"_hasShrinkwrap":false,"_cnpm_publish_time":1431374098612,"_cnpmcore_publish_time":"2021-12-13T19:14:25.045Z","contributors":[]},"1.1.1":{"name":"bytewise-core","version":"1.1.1","description":"Binary serialization of arbitrarily complex structures that sort element-wise","main":"index.js","scripts":{"test":"tape test | faucet"},"repository":{"type":"git","url":"https://github.com/deanlandolt/bytewise-core.git"},"keywords":["binary","sort","collation","serialization","leveldb","indexeddb"],"author":{"name":"Dean Landolt","email":"dean@deanlandolt.com"},"license":"MIT","bugs":{"url":"https://github.com/deanlandolt/bytewise/issues"},"homepage":"https://github.com/deanlandolt/bytewise-core","dependencies":{"typewise-core":"^1.1"},"devDependencies":{"faucet":"0.0.1","tape":"^1.0"},"gitHead":"ed80a8fe366ecaa462706743683e656f07c3e0b4","_id":"bytewise-core@1.1.1","_shasum":"5c24c8d5dd4177b34ab539713b1749b73ee2dfcd","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"anonymous","email":"dean@deanlandolt.com"},"maintainers":[{"name":"anonymous","email":"dean@deanlandolt.com"}],"dist":{"shasum":"5c24c8d5dd4177b34ab539713b1749b73ee2dfcd","size":8168,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/bytewise-core/-/bytewise-core-1.1.1.tgz","integrity":"sha512-asmLByuU9khzyzrT69cj/sPM2WuVuVnjOhnHOLtw+DmDMcue7WvZ6c/ggkziiXPmDl6q4NRQddtrG7283jXTxw=="},"directories":{},"publish_time":1431365451912,"_hasShrinkwrap":false,"_cnpm_publish_time":1431365451912,"_cnpmcore_publish_time":"2021-12-13T19:14:25.239Z","contributors":[]},"1.1.0":{"name":"bytewise-core","version":"1.1.0","description":"Binary serialization of arbitrarily complex structures that sort element-wise","main":"index.js","dependencies":{"typewise-core":"^1.1.0"},"devDependencies":{"tape":"~1.0"},"scripts":{"test":"tape test"},"repository":{"type":"git","url":"https://github.com/deanlandolt/bytewise-core.git"},"keywords":["binary","sort","collation","serialization","leveldb","indexeddb"],"author":{"name":"Dean Landolt","email":"dean@deanlandolt.com"},"license":"MIT","bugs":{"url":"https://github.com/deanlandolt/bytewise/issues"},"homepage":"https://github.com/deanlandolt/bytewise-core","gitHead":"8d0b652dee1d1c095dee8ec91b5cb9c112383a3d","_id":"bytewise-core@1.1.0","_shasum":"5ced8e76fc03644e3debf2edfc9e9b780c862d53","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"anonymous","email":"dean@deanlandolt.com"},"maintainers":[{"name":"anonymous","email":"dean@deanlandolt.com"}],"dist":{"shasum":"5ced8e76fc03644e3debf2edfc9e9b780c862d53","size":8157,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/bytewise-core/-/bytewise-core-1.1.0.tgz","integrity":"sha512-cLDeSQcMvPJEZ+qq8mHW9R1sxj9kIA07eIuxt443DUgFj6844HLfJqia7J9E9K2o+wT3WNuMEUGo3QTGm8gMdg=="},"directories":{},"publish_time":1431363785498,"_hasShrinkwrap":false,"_cnpm_publish_time":1431363785498,"_cnpmcore_publish_time":"2021-12-13T19:14:25.495Z","contributors":[]},"1.0.0":{"name":"bytewise-core","version":"1.0.0","description":"Binary serialization of arbitrarily complex structures that sort element-wise","main":"index.js","dependencies":{"bops":"~0.1","typewise-core":"^1.0.0"},"devDependencies":{"tape":"~1.0"},"scripts":{"test":"tape test"},"repository":{"type":"git","url":"https://github.com/deanlandolt/bytewise-core.git"},"keywords":["binary","sort","collation","serialization","leveldb","indexeddb"],"author":{"name":"Dean Landolt","email":"dean@deanlandolt.com"},"license":"MIT","bugs":{"url":"https://github.com/deanlandolt/bytewise/issues"},"homepage":"https://github.com/deanlandolt/bytewise-core","gitHead":"69f6dcb9e6b47ebf744e1092bfe5d959e748a7e1","_id":"bytewise-core@1.0.0","_shasum":"653f08fe684700611d5dfa00e10beee8b91b387b","_from":".","_npmVersion":"2.7.0","_nodeVersion":"0.10.35","_npmUser":{"name":"anonymous","email":"dean@deanlandolt.com"},"maintainers":[{"name":"anonymous","email":"dean@deanlandolt.com"}],"dist":{"shasum":"653f08fe684700611d5dfa00e10beee8b91b387b","size":7957,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/bytewise-core/-/bytewise-core-1.0.0.tgz","integrity":"sha512-XM2I3/jx62HbW4FqtfCWwgBjZujfn3PJN3ftZp352BRD2dQfJbG+cSpdCnfDQnXGwqtSTRjZOZTm7uealGMrng=="},"directories":{},"publish_time":1428376387575,"_hasShrinkwrap":false,"_cnpm_publish_time":1428376387575,"_cnpmcore_publish_time":"2021-12-13T19:14:25.770Z","contributors":[]}},"dist-tags":{"latest":"1.2.3"},"name":"bytewise-core","time":{"created":"2022-01-27T01:02:19.482Z","modified":"2022-01-27T01:02:19.482Z","1.2.3":"2015-06-19T21:17:59.646Z","1.2.2":"2015-06-19T01:39:29.817Z","1.2.1":"2015-05-14T08:19:46.715Z","1.2.0":"2015-05-13T01:30:41.051Z","1.1.2":"2015-05-11T19:54:58.612Z","1.1.1":"2015-05-11T17:30:51.912Z","1.1.0":"2015-05-11T17:03:05.498Z","1.0.0":"2015-04-07T03:13:07.575Z"},"readme":"bytewise-core\n=============\n\nBinary serialization of arbitrarily complex structures that sort element-wise\n\n[![build status](https://travis-ci.org/deanlandolt/bytewise-core.svg?branch=master)](https://travis-ci.org/deanlandolt/bytewise-core)\n\nAllows efficient comparison of a variety of useful data structures in a way that respects the sort order defined by [typewise](https://github.com/deanlandolt/typewise).\n\nThis library defines a total order for well-structured keyspaces in key value stores. The ordering is a superset of the sorting algorithm defined by [IndexedDB](http://www.w3.org/TR/IndexedDB/#key-construct) and the one defined by [CouchDB](http://wiki.apache.org/couchdb/View_collation). This serialization makes it easy to take advantage of the benefits of structured indexing in systems with fast but naïve binary indexing (key/value databases).\n\n\n## Order of Supported Structures\n\nThis package is a barebones kernel of [bytewise](https://github.com/deanlandolt/bytewise), containing only the structures most often used to create structured keyspaces.\n\nThis is the top level order of the various structures that may be encoded:\n\n* `null`\n* `false`\n* `true`\n* `Number` (numeric)\n* `Date` (time-wise)\n* `Buffer`, `Uint8Array` (bit-wise)\n* `String` (character-wise)\n* `Array` (element-wise)\n* `undefined`\n\nStructured types like `Array` may recursively contain any other supported structures.\n\n\n## Usage\n\n`encode` serializes any supported type and returns a `Buffer`, or throws if an\nunsupported structure is provided.\n\n```js\nvar assert = require('assert')\nvar bytewise = require('./')\nvar encode = bytewise.encode\n\n// Numbers are stored in 9 bytes -- 1 byte for the type tag and an 8 byte float\nassert.equal(encode(12345).toString('hex'), '4240c81c8000000000')\n// Negative numbers are stored as positive numbers, but with a lower type tag and their bits inverted\nassert.equal(encode(-12345).toString('hex'), '41bf37e37fffffffff')\n\n// The `toString` method of `Buffer` values returned by `encode` is augmented\n// to use \"hex\" encoding by default. This ensures bytewise encoding still\n// works when bytewise keys are accidentally coerced to strings.\nassert.equal(encode(-12345) + '', '41bf37e37fffffffff')\n\n// All numbers, integer or floating point, are stored as IEEE 754 doubles\nassert.equal(encode(1.2345) + '', '423ff3c083126e978d')\nassert.equal(encode(-1.2345) + '', '41c00c3f7ced916872')\n\n// Serialization does not preserve the sign bit, so 0 is indistinguishable from -0\nassert.equal(encode(-0) + '', '420000000000000000')\nassert.equal(encode(0) + '', '420000000000000000')\n\n// Strings are encoded as utf8, prefixed with their type tag (0x70, or the \"p\" character)\nassert.equal(encode('foo').toString('utf8'), 'pfoo')\nassert.equal(encode('föo').toString('utf8'), 'pföo')\n\n// Arrays are just a series of values, separated by and terminated with a null byte\nassert.equal(encode([ 'foo', 'bar' ]) + '', 'a070666f6f00706261720000')\n\n// Items in arrays are delimited by null bytes, and a final end byte marks the end of the array\nassert.equal(encode([ 'foo' ]).toString('binary'), '\\xa0pfoo\\x00\\x00')\n\n// Complex types like arrays can be arbitrarily nested, and fixed-sized types don't require a terminating byte\nassert.equal(encode([ [ 'foo', 10 ], 'bar' ]) + '', 'a0a070666f6f0042402400000000000000706261720000')\n```\n\n\n`decode` parses a buffer and returns the structured data.\n  \n```js\nvar decode = bytewise.decode\nvar key = 'a0a070666f6f0042402400000000000000706261720000'\n\n// Decode takes a buffer and decodes a bytewise value\nassert.deepEqual(decode(new Buffer(key, 'hex')), [ [ 'foo', 10 ], 'bar' ])\n\n// String input can be decoded, defaulting to hex\nassert.deepEqual(decode(key), [ [ 'foo', 10 ], 'bar' ])\n\n// An alternate string encoding can be provided when initializing bytewise\n// TODO\n```\n\n\n## Use Cases\n\nTake a look at the [bytewise](https://github.com/deanlandolt/bytewise#use-cases) library for an idea of what kind of stuff this could be useful for.\n\n\n## Issues\n\nIssues should be reported [here](https://github.com/deanlandolt/bytewise/issues).\n\n\n## License\n\n[MIT](http://deanlandolt.mit-license.org/)","users":{}}