Skip to content

Latest commit

 

History

History
62 lines (47 loc) · 2.22 KB

README.md

File metadata and controls

62 lines (47 loc) · 2.22 KB

Bencode2Json

A .NET Core Library for converting Bencoded Dictionaries to Json Documents

Build status CodeFactor NuGet version

Overview

Bencoded dictionaries like the one shown below can easily be coverted to JSON using this library.

Bencode
d5:debug4:truee
JSON
{
    "debug": "true"
}

Installation

Install the package Bencode2Json from NuGet or install it from the Package Manager Console:

PM> Install-Package Bencode2Json

Usage

using Bencode2Json;
...
...
// BencodedData takes any Stream
var bencodedData = new BencodedData(dataStream);
var json = bencodedData.ConvertToJson();

Examples

Demos in the Examples folder.

TorrentFileParser

This demo parses an torrent file (which is basically a bencoded dictionary) and converts it to JSON. This JSON is then passed to the popular JSON library JSON.NET for converting it into C# objects.

Reference

License

license FOSSA Status

FOSSA Status