themasch/node-bencode — pull request #24 by deoxxa (2014-04-27 23:58:55+00:00)
Title: binary keys

Pretty derpy right now, and I'm not sure what the rate of collisions will be like, but this might be a viable approach... I don't expect this to be merged in - I just wanted to demonstrate the API I had in mind for this kind of feature.

```
> var b = require("./")
undefined
> var x = b.decode(fs.readFileSync("./scrape.dat"))
undefined
> x
{ files:
{ '���\u0012��W��\u0006�ǲ��G����':
{ complete: 2,
downloaded: 10,
incomplete: 275 } } }
> x.files.binaryKeys()
[ ]
> x.files.binaryGet(Buffer("91ee8212979857a5f4069ec7b28beb47cfc1dbf1", "hex"))
{ complete: 2,
downloaded: 10,
incomplete: 275 }
```