themasch/node-bencode — pull request #1 by jhermsmeier (2012-07-19 15:33:14+00:00)
Title: bencode.js update/rewrite

## Changes

- Improved speed (see benchmark)
- Moved anonymous functions out of `#encode()`
and `#decode()`
- `#decode()` now takes in a buffer (instead of a string)
- `#decode()` got an additional parameter, to automatically convert bytestrings to strings
- Improved legibility (IMHO)
- Removed deprecated and unused `require( 'sys' )`
- Updated `README`, `AUTHORS` and `package.json` accordingly

## Benchmark

```
new#encode( Object ) x 112,941 ops/sec ±0.43% (63 runs sampled)
old#encode( Object ) x 88,943 ops/sec ±0.53% (63 runs sampled)
```
```
new#decode( Buffer ) x 13,724 ops/sec ±0.70% (62 runs sampled)
new#decode( Buffer, true ) x 660 ops/sec ±0.50% (62 runs sampled)
old#decode( String ) x 299 ops/sec ±1.56% (56 runs sampled)
```