Yencer
Yencer encodes and decodes yEnc data
Install
$ npm install yencer
Todo
- yEnc encoding
- Multipart support
- Buffer/String issues
Examples
Get the Yencer class
var Yencer = ;
Decode a stream
Here I read out a usenet article stored to disk, including headers. Yencer will take care of it.
var fs = stream = Yencer; // Stream the article file into the decoderfs; // Stream the decoder output into a new filestream;
Decode an article
Here I read out a usenet article stored to disk, including headers. Yencer will take care of it.
// Get the buffer to the filevar buffer = fs; // Decode the buffer, which returns a YencFile objectvar result = Yencer; // Inspect the objectconsole; // { buffer: <Buffer ff d8 ff 64 ... >, // The thing you want // info: // Info from the yEnc headers // { part: 1, // total: '1', // line: 128, // filesize: 315836, // name: '1024x768_1283625878864.jpg', // begin: 1, // end: 315836, // partsize: 315836, // pcrc32: '72182d81' }, // ybegin: true, // If there was a ybegin line // ypart: true, // If there was a ypart line // yend: true, // If there was a yend line // intact: true, // If the checksums matched // checksum: '72182d81', // The decoded checksum // index: 315836, // Last written index // size: 315836 } // Supposed filesize