0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/doc/api
James M Snell 7d73e60f60 buffer: add swap16() and swap32() methods
Adds Buffer.prototype.swap16() and Buffer.prototype.swap32()
methods that mutate the Buffer instance in-place by swapping the
16-bit and 32-bit byte-order.

Example:

```js
const buf = Buffer([0x1, 0x2, 0x3, 0x4]);
buf.swap16();
console.log(buf);
  // prints Buffer(0x2, 0x1, 0x4, 0x3);

buf.swap32();
console.log(buf);
  // prints Buffer(0x3, 0x4, 0x1, 0x2);
```

PR-URL: https://github.com/nodejs/node/pull/5724
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-03-23 08:52:44 -07:00
..
_toc.markdown doc: add a cli options doc page 2016-03-21 17:33:42 -04:00
addons.markdown doc: fix typo in api/addons 2016-03-14 08:48:08 -07:00
all.markdown deps: update v8 to 4.4.63.9 2015-08-04 11:56:14 -07:00
assert.markdown doc: mention prototype check in deepStrictEqual() 2016-02-23 09:17:11 -05:00
buffer.markdown buffer: add swap16() and swap32() methods 2016-03-23 08:52:44 -07:00
child_process.markdown doc: Add note about use of JSON.stringify() 2016-03-15 09:38:28 -07:00
cli.markdown doc: add a cli options doc page 2016-03-21 17:33:42 -04:00
cluster.markdown doc: add missing property in cluster example 2016-02-27 14:04:51 +01:00
console.markdown console: check that stderr is writable 2016-03-15 19:10:55 -07:00
crypto.markdown doc: update crypto docs to use good defaults 2016-03-21 16:49:46 -07:00
debugger.markdown doc: replace function expressions with arrows 2016-01-27 23:00:20 +01:00
dgram.markdown doc: fix typo in api/dgram 2016-03-14 08:48:03 -07:00
dns.markdown doc: fix dns.resolveCname description typo 2016-03-10 02:16:36 +01:00
documentation.markdown doc: add info to docs on how to submit docs patch 2016-03-07 11:25:15 -08:00
domain.markdown doc: fix type references for link gen, link css 2016-02-09 13:12:21 +01:00
errors.markdown doc: fix markdown links 2016-03-10 14:09:26 +01:00
events.markdown doc: typo: interal->internal. 2016-03-22 23:26:27 +02:00
fs.markdown fs: add the fs.mkdtemp() function. 2016-03-20 11:49:02 +02:00
globals.markdown doc: proper markdown escaping -> \_\_, \*, \_ 2016-01-22 21:32:50 -08:00
http.markdown doc: fix markdown links 2016-03-10 14:09:26 +01:00
https.markdown doc: minor improvement to HTTPS doc 2016-02-01 09:14:42 -08:00
index.markdown
modules.markdown doc: explain error message on missing main file 2016-03-21 14:59:13 -07:00
net.markdown net: emit host in lookup event 2016-03-18 11:04:02 -05:00
os.markdown doc: minor improvement in OS docs 2016-02-04 19:25:07 +01:00
path.markdown doc: explain path.format expected properties 2016-03-22 23:46:33 +02:00
process.markdown doc: Add note about use of JSON.stringify() 2016-03-15 09:38:28 -07:00
punycode.markdown doc: fenced all code blocks, typo fixes 2016-01-21 20:55:09 +01:00
querystring.markdown doc: fix multiline return comments in querystring 2016-03-17 17:15:06 -03:00
readline.markdown doc: don't use "interface" as a variable name 2016-01-30 00:33:14 +01:00
repl.markdown repl: Assignment of _ allowed with warning 2016-03-18 21:03:40 +01:00
stream.markdown lib: reduce usage of self = this 2016-03-21 15:48:51 -07:00
string_decoder.markdown doc: fenced all code blocks, typo fixes 2016-01-21 20:55:09 +01:00
synopsis.markdown doc: harmonize $ node command line notation 2016-01-22 19:57:19 +01:00
timers.markdown doc: grammar, clarity and links in timers doc 2016-03-21 09:48:54 +02:00
tls.markdown doc: align doc/api/tls.markdown with style guide 2016-03-20 10:42:04 +02:00
tty.markdown doc: fenced all code blocks, typo fixes 2016-01-21 20:55:09 +01:00
url.markdown doc: fenced all code blocks, typo fixes 2016-01-21 20:55:09 +01:00
util.markdown doc: document deprecation of util._extend 2016-03-16 12:55:55 -07:00
v8.markdown doc: update V8 URL 2016-03-02 23:22:29 +01:00
vm.markdown vm: fix produceCachedData 2016-02-21 14:59:35 -05:00
zlib.markdown doc: clarify type of first argument in zlib 2016-03-15 12:09:38 -03:00