{
	"name": "bytewise-core",
	"versions": {
		"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": "deanlandolt",
				"email": "dean@deanlandolt.com"
			},
			"maintainers": [
				{
					"name": "deanlandolt",
					"email": "dean@deanlandolt.com"
				}
			],
			"dist": {
				"shasum": "653f08fe684700611d5dfa00e10beee8b91b387b",
				"tarball": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.0.0.tgz"
			},
			"directories": {},
			"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": "deanlandolt",
				"email": "dean@deanlandolt.com"
			},
			"maintainers": [
				{
					"name": "deanlandolt",
					"email": "dean@deanlandolt.com"
				}
			],
			"dist": {
				"shasum": "5ced8e76fc03644e3debf2edfc9e9b780c862d53",
				"tarball": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.1.0.tgz"
			},
			"directories": {},
			"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": "deanlandolt",
				"email": "dean@deanlandolt.com"
			},
			"maintainers": [
				{
					"name": "deanlandolt",
					"email": "dean@deanlandolt.com"
				}
			],
			"dist": {
				"shasum": "5c24c8d5dd4177b34ab539713b1749b73ee2dfcd",
				"tarball": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.1.1.tgz"
			},
			"directories": {},
			"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": "deanlandolt",
				"email": "dean@deanlandolt.com"
			},
			"maintainers": [
				{
					"name": "deanlandolt",
					"email": "dean@deanlandolt.com"
				}
			],
			"dist": {
				"shasum": "0d646277386c7cd3d732177effbb61229766970c",
				"tarball": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.1.2.tgz"
			},
			"directories": {},
			"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": "deanlandolt",
				"email": "dean@deanlandolt.com"
			},
			"maintainers": [
				{
					"name": "deanlandolt",
					"email": "dean@deanlandolt.com"
				}
			],
			"dist": {
				"shasum": "2d29d620fff10bf3c23d84be8eb092f2c470acbf",
				"tarball": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.2.0.tgz"
			},
			"directories": {},
			"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": "deanlandolt",
				"email": "dean@deanlandolt.com"
			},
			"maintainers": [
				{
					"name": "deanlandolt",
					"email": "dean@deanlandolt.com"
				}
			],
			"dist": {
				"shasum": "dbc950cdda149fc6d510d5c209ac07b8a270f193",
				"tarball": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.2.1.tgz"
			},
			"directories": {},
			"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": "deanlandolt",
				"email": "dean@deanlandolt.com"
			},
			"maintainers": [
				{
					"name": "deanlandolt",
					"email": "dean@deanlandolt.com"
				}
			],
			"dist": {
				"shasum": "da342754d27e3663881fef9dfdcbb61d5e8f57bf",
				"tarball": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.2.2.tgz"
			},
			"directories": {},
			"contributors": []
		},
		"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": "deanlandolt",
				"email": "dean@deanlandolt.com"
			},
			"maintainers": [
				{
					"name": "deanlandolt",
					"email": "dean@deanlandolt.com"
				}
			],
			"dist": {
				"shasum": "3fb410c7e91558eb1ab22a82834577aa6bd61d42",
				"tarball": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.2.3.tgz"
			},
			"directories": {},
			"contributors": []
		}
	},
	"time": {
		"modified": "2015-06-19T21:17:59.646Z",
		"created": "2015-04-07T03:13:07.575Z",
		"1.0.0": "2015-04-07T03:13:07.575Z",
		"1.1.0": "2015-05-11T17:03:05.498Z",
		"1.1.1": "2015-05-11T17:30:51.912Z",
		"1.1.2": "2015-05-11T19:54:58.612Z",
		"1.2.0": "2015-05-13T01:30:41.051Z",
		"1.2.1": "2015-05-14T08:19:46.715Z",
		"1.2.2": "2015-06-19T01:39:29.817Z",
		"1.2.3": "2015-06-19T21:17:59.646Z"
	},
	"users": {},
	"dist-tags": {
		"latest": "1.2.3"
	},
	"_uplinks": {
		"npmjs": {
			"etag": "W/\"be1958d28d824c41f9bfafbfb8298632\"",
			"fetched": 1602009448791
		}
	},
	"_distfiles": {
		"bytewise-core-1.0.0.tgz": {
			"url": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.0.0.tgz",
			"sha": "653f08fe684700611d5dfa00e10beee8b91b387b",
			"registry": "npmjs"
		},
		"bytewise-core-1.1.0.tgz": {
			"url": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.1.0.tgz",
			"sha": "5ced8e76fc03644e3debf2edfc9e9b780c862d53",
			"registry": "npmjs"
		},
		"bytewise-core-1.1.1.tgz": {
			"url": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.1.1.tgz",
			"sha": "5c24c8d5dd4177b34ab539713b1749b73ee2dfcd",
			"registry": "npmjs"
		},
		"bytewise-core-1.1.2.tgz": {
			"url": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.1.2.tgz",
			"sha": "0d646277386c7cd3d732177effbb61229766970c",
			"registry": "npmjs"
		},
		"bytewise-core-1.2.0.tgz": {
			"url": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.2.0.tgz",
			"sha": "2d29d620fff10bf3c23d84be8eb092f2c470acbf",
			"registry": "npmjs"
		},
		"bytewise-core-1.2.1.tgz": {
			"url": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.2.1.tgz",
			"sha": "dbc950cdda149fc6d510d5c209ac07b8a270f193",
			"registry": "npmjs"
		},
		"bytewise-core-1.2.2.tgz": {
			"url": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.2.2.tgz",
			"sha": "da342754d27e3663881fef9dfdcbb61d5e8f57bf",
			"registry": "npmjs"
		},
		"bytewise-core-1.2.3.tgz": {
			"url": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.2.3.tgz",
			"sha": "3fb410c7e91558eb1ab22a82834577aa6bd61d42",
			"registry": "npmjs"
		}
	},
	"_attachments": {
		"bytewise-core-1.2.3.tgz": {
			"shasum": "3fb410c7e91558eb1ab22a82834577aa6bd61d42"
		}
	},
	"_rev": "12-e2f5fa173402d523",
	"_id": "bytewise-core",
	"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/)"
}