{"bugs":{"url":"https://github.com/mattcg/network-byte-order/issues"},"dist":{"shasum":"6ac11bf44bf610daeddbe90a09a5c817c6e0d2b3","tarball":"https://registry.npmjs.org/network-byte-order/-/network-byte-order-0.2.0.tgz","integrity":"sha512-oUG/1/fdDdv4Xfkct2wxVWuF/70ZUWsv9ZYfkoxeQFnU1Q5y4H2huUzJD5Np7Xbi/baefJMnnIiZs8YFqMkQaA==","signatures":[{"sig":"MEYCIQCe3zDDHYAUo62tK5cd7F2dBokACkzNU8B2dM0Mfk+pvgIhAPrxgcDqzTba4tk4tOZCgbEFZLZ6/wrzxl6v6BNvJH78","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/index.js","name":"network-byte-order","_from":".","readme":"# JavaScript implementation of htonl, htons, ntohl, ntohs #\n\n[![Build Status](https://travis-ci.org/mattcg/network-byte-order.png?branch=master)](https://travis-ci.org/mattcg/network-byte-order)\n[![Coverage Status](https://coveralls.io/repos/mattcg/network-byte-order/badge.png)](https://coveralls.io/r/mattcg/network-byte-order)\n\nThese routines are used for converting values between host and [network byte order](http://en.wikipedia.org/wiki/Endianness#Endianness_in_networking).\n\nDerived from [an implementation](http://blog.couchbase.com/starting-membase-nodejs) by Membase, Inc.\n\n## Usage ##\n\n### htonl(b, i, v) ###\n\nThe `htonl()` function converts the given unsigned 32-bit (long) integer from host byte order to network byte order (Little-Endian to Big-Endian).\n\n`b` is an [`Array`](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array) of octets or a Node.JS [`Buffer`](http://nodejs.org/api/buffer.html).\n`i` is the zero-based index at which to write into `b`.\n`v` is the value to convert.\n\n### htons(b, i, v) ###\n\nThe `htons()` function converts the given unsigned 16-bit (short) integer from host byte order to network byte order (Little-Endian to Big-Endian).\n\n`b` is an [`Array`](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array) of octets or a Node.JS [`Buffer`](http://nodejs.org/api/buffer.html).\n`i` is the zero-based index at which to write into `b`.\n`v` is the value to convert.\n\n### ntohl(b, i) ###\n\nThe `ntohl()` function converts the unsigned 32-bit (long) integer from network byte order to host byte order (Big-Endian to Little-Endian).\n\n`b` is an [`Array`](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array) of octets or a Node.JS [`Buffer`](http://nodejs.org/api/buffer.html) to read the value from.\n`i` is the zero-based index at which to read from `b`.\n\n### ntohlStr(s, i) ###\n\n`s` is a `string` to the read value from.\n`i` is the zero-based index at which to read from `s`.\n\n### ntohs(b, i) ###\n\nThe `ntohs()` function converts the unsigned 16-bit (short) integer from network byte order to host byte order (Big-Endian to Little-Endian).\n\n`b` is an [`Array`](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array) of octets or a Node.JS [`Buffer`](http://nodejs.org/api/buffer.html) to read the value from.\n`i` is the zero-based index at which to read from `b`.\n\n### ntohsStr(s, i) ###\n\n`s` is a `string` to the read value from.\n`i` is the zero-based index at which to read from `s`.\n\n## License ##\n\nLicensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).\n","_npmUser":{"name":"mcg","email":"m@m.cg"},"homepage":"https://github.com/mattcg/network-byte-order","keywords":["htonl","htons","ntohl","ntohs","byte order","endian","endianness","convert"],"licenses":[{"url":"http://www.apache.org/licenses/LICENSE-2.0","type":"Apache License, Version 2.0"}],"implements":["CommonJS/Modules/1.0"],"repository":{"url":"https://github.com/mattcg/network-byte-order.git","type":"git"},"_npmVersion":"1.3.8","description":"htonl, htons, ntohl, ntohs - convert values between host and network byte order.","maintainers":[{"name":"mcg","email":"m@m.cg"}],"contributors":[{"name":"Matthew Caruana Galizia","email":"m@m.cg"}],"readmeFilename":"README.md","devDependencies":{"mocha":"1.x","coveralls":"2.x","jscoverage":"0.x","mocha-lcov-reporter":"0.x"},"_id":"network-byte-order@0.2.0","version":"0.2.0"}